Adjacency List Graph Engine
Allocates an array of |V| dynamic neighbor vectors, providing optimal O(1) neighbor iteration per edge with zero unused matrix memory.
To investigate fundamental graph representations (Adjacency Matrix vs. Adjacency List), evaluate the asymptotic time and space complexity of Breadth-First Search (BFS) and Depth-First Search (DFS), analyze edge relaxation mechanics in Dijkstra's Single-Source Shortest Path algorithm, and verify the linear scaling law T(|V|) = |V| + |E| = 5.0000·|V| across sparse networks with average degree d = 4. Explore interactive search algorithms, compare operation counts and analyse complexity scaling.
Ready to execute vertex count benchmark.
Adjust vertex count n, then execute benchmark.
Operation counts are generated deterministically by the exact algorithmic execution model. Modern hardware benchmarks additionally reflect cache line prefetching and branch misprediction penalties.
The simulated execution environment models idealized graph traversal where memory operations execute with deterministic cost T(|V|) = |V| + |E|. In physical microprocessors, traversal latency is modulated by CPU L1/L2 data cache hit ratios during pointer chasing across non-contiguous adjacency nodes, Translation Lookaside Buffer (TLB) virtual memory page walks, branch predictor stalls during neighbor iteration termination, and DRAM memory bus contention. In an Adjacency List representation of a graph G = (V, E), Breadth-First Search (BFS) and Depth-First Search (DFS) guarantee that every vertex is discovered and enqueued/pushed exactly once (|V| operations) and every incident directed edge is traversed exactly once (|E| operations). In a network with average out-degree d = 4, total edges |E| = 4|V|, yielding total elementary operations T(|V|) = |V| + |E| = (1 + 4)|V| = 5.0000·|V| operations with zero intercept T_0 = 0.0000.
Allocates an array of |V| dynamic neighbor vectors, providing optimal O(1) neighbor iteration per edge with zero unused matrix memory.
Simulates a dense |V| × |V| 2D array to evaluate memory footprint scaling (Θ(V²)) and compare O(1) edge lookup vs. O(V) neighbor scan latency.
Implements dual-mode FIFO queue (for BFS level-order exploration) and LIFO activation stack (for DFS back-edge discovery) with visited bitfield sets.
Maintains tentative shortest path distances supporting O(log V) extract_min and O(log V) decrease_key operations via an inverted vertex index map.
Evaluates the triangular inequality dist[v] > dist[u] + w(u, v) during Dijkstra execution, updating predecessor pointers to record the Shortest Path Tree.
Monitors discrete vertex discovery steps, edge exploration counts, CPU L1/L2 cache hit ratios, and memory bus transaction cycles during graph walks.
To investigate fundamental graph representations (Adjacency Matrix vs. Adjacency List), evaluate the asymptotic time and space complexity of Breadth-First Search (BFS) and Depth-First Search (DFS), analyze edge relaxation mechanics in Dijkstra's Single-Source Shortest Path algorithm, and verify the linear scaling law T(|V|) = |V| + |E| = 5.0000·|V| across sparse networks with average degree d = 4. Suggested independent settings: 50, 100, 200, 300, 500, 750, 1000 vertices.
Construct a connected directed graph G = (V, E) with |V| vertices and average out-degree d = 4 edges per vertex (|E| = 4|V|). Verify network connectivity using Tarjan's strongly connected components algorithm to ensure all vertices are reachable from source s = 0.
Allocate an array of |V| head pointers. Populate neighbor vectors with directed edge endpoints and positive integer weights w(u, v) ∈ [1, 20] chosen from a uniform pseudo-random distribution.
Designate vertex s = 0 as the source. Clear visited bitmask flags. Initialize distance array dist[s] = 0 and dist[v] = ∞ for all v ≠ s. Enqueue the source vertex into the traversal frontier register.
Execute the traversal loop: in each step, dequeue the active vertex u from the frontier, mark u as visited, and increment the vertex visit counter. Iterate through all out-edges (u, v) incident to u, incrementing the edge inspection counter and enqueuing unvisited neighbors.
Repeat traversal benchmarking across vertex scales |V| ∈ [50, 100, 200, 300, 500, 750, 1000] vertices (corresponding to edge counts |E| ∈ [200, 400, 800, 1200, 2000, 3000, 4000]). Record total elementary operations T(|V|) = |V| + |E|.
Regress total operations T(|V|) against vertex count |V|. Calculate regression slope k_graph, intercept b, coefficient of determination R², and standard errors to verify the asymptotic complexity bound Θ(|V| + |E|) = 5.0000·|V|.
Points are your recorded benchmark observations. The regression line validates Graph Traversal & Shortest Paths complexity scaling.
| # | Graph vertex count |V| (network with average degree d = 4, |E| = 4|V|) (vertices) | Total elementary traversal operations T(|V|) (operations) | Network vertex count |V| (vertices) | Total traversal operations T(|V|) = |V| + |E| (operations) | Remove |
|---|
No readings yet. Execute a vertex count benchmark and record it.