Dijkstra's shortest path algorithm and Prim's eager minimum spanning tree