Graph Representation — Interactive Visualization

Click Sample for a starter graph, or add edges with the controls.
Vertices: 5
Edges: 0
Mode: undirected
Matrix space: O(V²)
vertex queried endpoint last added

Adjacency Matrix space O(V²) · hasEdge O(1)

Adjacency List space O(V+E) · neighbors O(d)

Edge List space O(E) · hasEdge O(E)