- The paper provides a framework for maintaining explicit BFS trees and global BFS orderings in directed graphs under fully dynamic edge updates.
- It introduces efficient locality-preserving update routines that adjust the tree structure, node levels, and per-level indices upon edge insertions or deletions.
- The approach yields worst-case linear update time proportional to the affected region, advancing techniques in dynamic graph traversal.
Fully Dynamic Maintenance of BFS Trees and Orderings in Directed Graphs
Introduction and Problem Statement
The paper "Fully Dynamic Breadth First Search and Spanning Trees in Directed Graphs" (2604.12370) investigates the challenging problem of maintaining a breadth-first spanning tree (BFST) and the global BFS order in a directed graph subject to arbitrary sequences of edge insertions and deletions. Unlike prior work, which has largely focused on reachability, distance labels, or semi-dynamic (incremental or decremental) scenarios, the paper introduces a framework for explicitly maintaining the parent structure, per-node levels, and a per-level-stable, globally consistent BFS numbering, supporting both edge insertions and deletions efficiently.
Maintaining not only per-node distance but also an explicit spanning tree and a per-level BFS ordering is a critical requirement in applications such as incremental single-source shortest paths (unit-weight SSSP), reachability maintenance, and algorithms for higher-level structural analyses such as SCC maintenance. The task is especially subtle in directed graphs, where affected regions under updates can be highly nonlocal, and the BFS layering and tie-breaking orderings present unique challenges distinct from DFS maintenance.
While the classical Even-Shiloach (ES-tree) data structure addresses online edge deletions for SSR with linear total update time, it only preserves reachability and does not track explicit BFS tree or order [10.1145/32(2234.32223)5]. Later work extends the complexity bounds or adopts randomized sublinear-time algorithms for SSR and SSSP [10.1145/259(1796.25918)69, 7782945]. Semi-dynamic BFS and order maintenance was investigated in [FRANCIOSA2001201]; however, this prior art neither preserves a global BFS ordering nor supports general fully dynamic edge updates with explicit BFS-level tie-breaking.
Maintenance of DFS trees in dynamic directed graphs is known [10.14778/3364324.3364329], but BFS presents fundamentally different algorithmic invariants: in BFS, level-minimality is required, and forward edges across layers violate the minimal path property. This necessitates a new approach not transferrable from DFS frameworks. There is also discussion of lexicographic BFS approaches and partition refinement [RoseTL76, HabibMPV00], but the presented framework avoids their overhead by focusing on BFS-level stability rather than lex order rigidity.
Algorithmic Framework and Data Structures
The central contribution is an explicit framework for maintaining:
- pred[v]: the BFST parent of each vertex,
- level[v]: BFS distance from the root,
- succ[u]: BFST children,
- bfs_int[v] and bfs_revint[i]: BFS ordering and its inversion,
- bfs_level: index boundaries for each BFS level in the global order.
The framework leverages strong locality guarantees: only regions affected by a structural update (due to insertion shortening or deletion breaking the parent–child path) are reconsidered. Broadly, edge insertions may decrease levels and trigger tree reparenting and renumbering in the improved region, while edge deletions may necessitate replacement parents or, if not possible, increase levels or remove unreachable nodes.
Invariant Maintenance
The framework maintains three explicit invariants:
- Depth-parent rule: For all reachable v=r, level[v]=level[pred[v]]+1.
- Contiguous levels: All vertices of BFS level ℓ occupy a contiguous block of indices in bfs_revint, with level[v]0 marking each endpoint.
- Stable per-level order: Within a BFS level, relative order is consistent with the BFS parent’s BFS index; unaffected vertices retain their order.
These invariants allow for stable reference to per-level blocks and facilitate efficient layer-wise renumbering and reparenting.
Update Algorithms: Incremental and Decremental
Edge Insertion
An edge insertion is only relevant if it introduces a shorter or better-tied path to the destination or if it connects a previously unreachable region. The algorithm identifies the affected substructure and reemits vertices, updating parent, level, and BFS index only for those directly impacted.
When a new edge level[v]1 potentially shortens the path to level[v]2, the process begins by layering out from level level[v]3, updating the affected subtree, and propagating per-layer as required. This is summarized in Figure 1.
Figure 1: The insertion of edge level[v]4 shortens the BFS path to vertex level[v]5, requiring tree restructuring and partial renumbering.
Edge Deletion
Edge deletions that remove a BFST edge level[v]6 trigger a repair routine: alternative parents are sought among the incoming neighbors of potentially disconnected nodes. For each successor, the algorithm verifies reachability, reattaches using non-tree edges if possible, or otherwise marks them as unreachable. Level increases and renumbering are restricted to the affected subtree, and nodes that cannot be reattached are removed from the BFST. The repair proceeds in layered sweeps, explicitly updating only those vertices whose parent or level changes.
This approach enables both efficient handling of local disruptions and worst-case linear work in the size of the affected region (not the entire graph), as highlighted in Figure 2.
Figure 2: Deletion of tree-edge level[v]7 is shown, with reachability repairs and careful maintenance of BFS invariants.
Complexity
Update routines have worst-case complexity level[v]8, where level[v]9 are the affected vertices and succ[u]0 are their adjacent edges, matching the affected region’s size. Thus, when a change only perturbs a local region, updates are highly efficient, but the worst case remains succ[u]1. This matches the lower bounds for SSSP and SSR maintenance in dynamic digraphs.
Empirical Capabilities and Design Principles
The method's key strengths are:
- Compact state: All per-vertex and per-level information fits in succ[u]2 space, and no auxiliary "star" or partition-refinement structures are required.
- Work efficiency: Only affected vertices are reconsidered during structural updates, leading to linear work in the changed region.
- Explicit order preservation: The BFS-ordering is maintained globally, even as subcomponents are merged or disconnected, supporting further graph operations that rely on global per-level traversal orders.
- Independence from connectivity assumptions: The framework applies to arbitrary digraphs with a fixed source, and makes no special assumptions (e.g., SCC structure or CFG properties).
Figure 3 illustrates the initial configuration, emphasizing the distinction between tree and non-tree edges, and the importance of BFS-order-maintained numbering.
Figure 3: The initial directed graph with explicit BFST and global BFS numbering, setting up the state for subsequent dynamic updates.
Theoretical and Practical Implications
The explicit BFS tree and ordering enable applications in dynamic SSSP, SSR, dynamic SCC detection, and traversal-based incremental algorithms. The approach substantially advances previous results in semi-dynamic BFS in digraphs by supporting both insertions and deletions with full traversal maintenance—something not previously realized in the literature for the general setting.
Future work could address the gap in dynamic lexicographic BFS, which may enable stronger tie-breaking and order invariants but at higher maintenance cost. Further, the data structures and invariants presented may serve as building blocks for fully dynamic SCC, block-cut tree, or dominance frontier maintenance, potentially in combination with dynamic DFS frameworks.
Conclusion
This paper rigorously addresses the fully dynamic maintenance of BFS trees and explicit BFS orderings in directed graphs, supporting both edge insertions and deletions without full recomputation. The locality-preserving update routines, stable per-level order, and compact state set a new standard for dynamic traversal structure maintenance in digraphs. The approach fills a gap left by earlier semi-dynamic and distance-label-only algorithms, offering both stronger guarantees and broader applicability to dynamic graph analytic workloads.