Dijkstra Finding the shortest path in a directed graph by Dijkstra's algorithm Graph is presented as a nested dictionary { 1: {2: 1, 3: 1}, 2: {3: 1, 5: 1}, 3: {4: 1, 6: 1}, 5: {6: 1}, 4: {1: 1, 7: 1}, 6: {4: 1}, 7: {} }