Skip to content

algo.dijkstra.singleSource is the one weighted procedure that still abandons the CSR on every commit #6791

Closed

Description

@lvca

Follow-up from #6315 (PR #6788), raised in review of it.

#6315 made a Graph Analytical View answer edge properties exactly while a delta overlay is active, so the
weighted procedures that read them through GraphTraversalProvider.edgeWeightsOf - algo.mst, algo.msa,
algo.steinerTree, algo.bellmanford, algo.apsp, algo.maxKCut, astar(), bellmanFord() - keep the
columnar path across a commit instead of falling back to the edge records.

algo.dijkstra.singleSource does not. Its CSR path is GraphAlgorithms.dijkstraSingleSource, a kernel that
reads csr.getForwardOffsets()/getForwardNeighbors() and the weight column's typed arrays directly - which
is what makes it worth having, and also what makes it unable to see the overlay. It now refuses outright when
one is active (view.hasActiveOverlay()) and falls all the way back to the OLTP per-edge-record path.

That refusal is not a regression - before #6315 the same thing happened, just for a different reason (the
view reported no edge properties at all while an overlay was active, so the guard above the kernel never let
it in). It is simply the one caller that did not get the improvement, and against a SYNCHRONOUS view - where
an overlay is what every commit produces - it means this procedure reads edge records approximately always.

What it would take

The kernel walks the CSR slices per popped node, so the shape that fits is the same one
GraphAnalyticalView.edgeWeightsForSlice already implements: ask the view for the node's neighbours and
their weights rather than indexing the arrays. That costs an allocation per popped node, which is exactly what
the kernel exists to avoid, so it wants measuring rather than assuming - possibly a reusable buffer variant of
edgeWeightsForSlice, or keeping the raw path when no overlay is active and using the slice API only when one
is.

Worth noting

The rest of GraphAlgorithms (BFS, PageRank, WCC, label propagation, betweenness, ...) reads the base CSR
arrays the same way and is overlay-blind for topology, not merely for weights. That is a wider and older
question than this one and should not be folded into it, but anyone picking this up will meet it immediately.

Activity

  1. added this to the 26.9.1 milestone on Aug 27, 2026
  2. self-assigned this
    on Aug 27, 2026
  3. added
    engine
    enhancement
    on Aug 30, 2026
  4. added
    in progress
    on Sep 1, 2026
  5. self-assigned this
    on Sep 1, 2026
  6. added a commit that references this issue on Sep 2, 2026
  7. lvca commented on Sep 2, 2026

    @lvca
    MemberAuthor

    Fixed in #7001.

    algo.dijkstra.singleSource was the last weighted procedure that gave up on the fast columnar path whenever the Graph Analytical View had uncommitted-to-the-view changes pending. With a SYNCHRONOUS view that is the state after every single commit, so in practice the procedure was almost always falling back to reading edge records one by one - much slower, on exactly the graphs where the view was supposed to help.

    It now keeps using the fast path and resolves those pending changes as it goes, the same way algo.mst, algo.steinerTree, astar() and bellmanFord() already did. Results are unchanged; it's a speed fix.

    There is one case it still can't answer exactly - when several parallel edges join the same pair of nodes and only some of them were deleted. There it falls back to reading the edge records rather than guessing, so you always get the correct answer.

    No action needed on your side.


    ❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.

  8. removed
    in progress
    on Sep 2, 2026
  9. added a commit that references this issue on Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

engineenhancementopencypherperformance

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions