- graph traversal
- BFS: start with given node; visit node popped from queue, add unvisited nodes to queue, repeat until nodes exhausted
- DFS: start from any node; for each unvisited node, DFS-visit all unvisited neighbors
- time complexity for both BFS & DFS: O(V+E) if adjacency list, O(V2) if adjacency matrix
- graph single-source shortest path (shortest destination)
- Bellman-Ford algorithm: for ∣V∣−1 times: loop over all edges and try to update dv and πv; do a final iteration to check if there is a negative-weight cycle
- Dijkstra’s algorithm: initialize min priority queue keyed by dv; pop a node u, for each directed edge (u,v), try to update the neighbor v‘s distance
- time complexity: O(V2) w/o priority queue or O(ElogV) with priority queue)
- find minimum spanning tree for an undirected graph