HomeAlgorithms & AIGraph Database Shortest-Path Query: Bidirectional BFS (2D)

Graph Database Shortest-Path Query: Bidirectional BFS (2D)

Interactive 2D interference-free graph simulator: watch bidirectional BFS and single-direction BFS resolve a shortest-path query over a live planar spring-electrical graph embedding, with a live growth-curve chart plotting nodes visited per BFS layer for both strategies side by side.

Algorithms & AI2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-graph-database-shortest-path-query ↗ Open standalone

Graph databases answer "what's the shortest path between these two records" by walking index-free adjacency pointers directly, node to node, rather than joining tables. This 2D simulator lays out a random connected property graph with its own planar spring-electrical physics and runs a real breadth-first search across it: a single expanding wavefront from the source, or two wavefronts — one from the source, one from the target — expanding toward each other until they meet. A live growth-curve chart plots the actual measured nodes-visited-per-layer for the running strategy against the untouched other strategy on the identical graph, so the exponential cost gap that makes bidirectional search the standard approach in engines like Neo4j and Amazon Neptune is drawn directly from real traversal data rather than asserted.

⚙ Under the hood

Watch bidirectional and single-direction BFS resolve a shortest-path query over a live 2D planar spring-electrical graph embedding, with a real-time growth-curve chart plotting nodes visited per BFS layer for both strategies on the same graph.

graph databaseshortest pathBFSbidirectional searchindex-free adjacency2D

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)