

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: Graphs
incomplete
2: Graph Review
incomplete
3: Adjacency List
incomplete
4: Representing Graphs
incomplete
5: Adjacent Nodes
incomplete
6: Unconnected Vertices
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
When an algorithm traverses a graph, it typically moves across the edges.
| Use Case | Vertex | Edge |
|---|---|---|
| Social Networks | User | Connection |
| Road Maps | Location | Road |
| Networks | Computer | Cable |
| Game Dev | Tile | Path |
| AI Decision | State | Action |
Graphs can have any number of vertices.
Unlike trees, graphs don't need a root (a single top vertex that every other vertex descends from).
An undirected graph can have up to n(n - 1)/2 edges for n vertices.
Vertices can exist without edges but may be disconnected (and thus kinda useless)
Typically graphs (with the exception of multigraphs) can only have a single edge between two vertices
Weighted graphs assign values (costs) to edges (we'll cover this in a future course)