DSA Visualized
← All topics
hub

Graphs

Anything connected to anything.

01

Breadth-First Search

Explore a network in rings, nearest first — using a queue.

play_circle
02

Depth-First Search

Plunge down one path to the end, then back up and try the next.

play_circle
03

Topological Sort

Put jobs in an order where nothing happens before what it depends on.

play_circle
04

Dijkstra's Shortest Path

The cheapest route through a weighted map — always finish the nearest place first.

play_circle
05

Bellman–Ford

Slower than Dijkstra, and it can do the one thing Dijkstra can't.

play_circle
06

A* Search

Dijkstra with a sense of direction — it guesses what's left, and aims.

play_circle
07

Union-Find

Merge groups and ask 'are these two connected?' — in effectively constant time.

play_circle