Benchmark Family
Graph Traversal
Adjacency-list graph benchmarks for traversal, components, topological ordering, and cycle detection.
Generated
Apr 28, 2026, 12:07 PM
Measured
380
Skipped
1,300
Failures
0
Algorithms
8
Graph profiles
10
How to Read These Results
Benchmarks measure specific local JavaScript implementations on deterministic inputs. Results depend on runtime, hardware, implementation details, and input shape. They are not universal algorithm rankings.
BFS, DFS, components, topological sort, and cycle detection answer different graph questions, so summaries stay task-specific.
Algorithms Tested
Readable implementations included in this run
Breadth-First Search
Traversal From Start / Traversal OrderQueue-based breadth-first traversal from a start node.
DFS Iterative
Traversal From Start / Traversal OrderStack-based depth-first traversal from a start node.
DFS Recursive
Traversal From Start / Traversal OrderRecursive depth-first traversal from a start node; skipped when recursion depth risk is high.
Connected Components
Connected Components / Component LabelsIterative full-graph component labeling for undirected graphs.
Topological Sort (Kahn)
Topological Sort / Topological OrderKahn's indegree-queue topological ordering for DAGs.
Topological Sort (DFS)
Topological Sort / Topological OrderIterative DFS finishing-order topological ordering for DAGs.
Cycle Detection (Directed)
Cycle Detection / Cycle BooleanIterative color-state DFS cycle detection for directed graphs.
Cycle Detection (Undirected)
Cycle Detection / Cycle BooleanIterative parent-tracking DFS cycle detection for undirected graphs.
Graph profiles
Fixture coverage in this family
Task types
Fixture coverage in this family
Summary Findings
Careful takeaways from the generated benchmark data
- Comparable groups are task-specific: traversal, components, topological sort, and cycle detection are not ranked together.
- Recursive DFS is skipped on larger/deeper fixtures to avoid JavaScript call-stack risk.
- Chart-ready data exists for future visualization work, but this page stays table-based.
Chart Previews
Static previews from the existing chart-ready benchmark exports. These charts are read-only summaries, not live benchmark execution or universal rankings.
Traversal Runtime on Grid Graphs
Median runtime by graph size for compatible traversal implementations on deterministic grid graphs.
3 series, 8 plotted points. Unit: median ms.
Only traversal-from-start cases with start-0 are compared.
Traversal Work on Grid Graphs
Edges scanned by graph size. Work counters help explain behavior beyond timing noise.
3 series, 8 plotted points. Unit: edges scanned.
Edges scanned are local instrumentation from these implementations.
Topological Sort Runtime
Median runtime for Kahn and DFS topological sort on the layered DAG fixture.
2 series, 6 plotted points. Unit: median ms.
Topological sort previews include DAG fixtures only.
Compatibility Skips
Grouped skip reasons from the graph traversal benchmark summary.
4 bars. Unit: skipped cases.
Many skips are expected because graph algorithms answer different task-specific questions.
Task-Specific Summaries
Each task is summarized separately because the algorithms answer different graph questions.
| Task | Algorithms | Profiles | Measured | Skipped | Failures |
|---|---|---|---|---|---|
| Traversal From Start | Bfs, Dfs Iterative +1 | Dag Chain, Dag Layered +8 | 320 | 40 | 0 |
| Connected Components | Connected Components | Disconnected Components, Grid Graph +4 | 18 | 12 | 0 |
| Topological Sort | Topological Sort Kahn, Topological Sort Dfs | Dag Chain, Dag Layered | 12 | 48 | 0 |
| Directed Cycle Detection | Cycle Detection Directed | Dag Chain, Dag Layered +2 | 12 | 0 | 0 |
| Undirected Cycle Detection | Cycle Detection Undirected | Disconnected Components, Grid Graph +4 | 18 | 0 | 0 |
Skip Reason Summary
Grouped skip reasons keep unsupported task/profile combinations explicit.
| Category | Count | Example reason |
|---|---|---|
| Unsupported task | 1,170 | BFS is only run for traversal-from-start tasks |
| Requires directed graph | 78 | connected components benchmark skips directed graphs |
| Recursion depth risk | 40 | recursive DFS skipped for graphs above 1,000 nodes to avoid call-stack risk |
| Requires DAG | 12 | topological sort skips non-DAG profiles |
Operation Metric Preview
Local normalized metrics can help explain behavior beyond raw timing.
| Algorithm | Task | Median nodes | Median edges | us/edge |
|---|---|---|---|---|
| Bfs | Traversal From Start | 784 | 1,552 | 0.005 |
| Connected Components | Connected Components | 1,000 | 3,860 | 0.004 |
| Cycle Detection Directed | Cycle Detection | 550 | 625 | 0.013 |
| Cycle Detection Undirected | Cycle Detection | 102 | 198 | 0.022 |
| Dfs Iterative | Traversal From Start | 784 | 1,552 | 0.005 |
| Dfs Recursive | Traversal From Start | 100 | 398 | 0.006 |
Graph-shape notes
Context for interpreting this family
- path-graph stresses traversal depth and recursive DFS stack risk.
- star-graph stresses high-degree hub adjacency scanning.
- grid-graph provides spatially regular sparse connectivity.
- random-dense-undirected increases edge scanning cost and is edge-capped.
- DAG fixtures are the only valid topological-sort inputs.
Outputs
Generated benchmark artifacts used by this public page
Limitations
Scope boundaries for this benchmark family
- Synthetic adjacency-list graph fixtures only.
- Dense graph edge counts are capped.
- Recursive DFS is skipped above 1,000 nodes to avoid JavaScript call-stack risk.
- Normalized per-node and per-edge metrics are derived local implementation measurements.
- Memory usage and browser-runtime behavior are not measured.