Adjacency Matrix
A V x V grid where cell (u, v) marks an edge from u to v.
Decision · step 2 of 7Matrix: Adjacency matrix from edges
Edge 0-1: set (0, 1) and (1, 0) to 1. 1 of 5 edges placed.
What you will see
The same graph shown as picture and as grid; hovering an edge highlights its cell.
Cost
| edge lookup | O(1) |
|---|---|
| neighbours | O(V) |
| add edge | O(1) |
| Space | O(V^2) |
How you work with it here
play it through, step one change at a time, scrub to any step, run it on your own input, try operations in any order.
Screen readers: Each element is an accessibility element with position, value and state; structural changes are announced per step.
Reduced motion: Elements appear at their destination with a crossfade; no travel longer than the element's own size.