import notebooks.Graph as Graph from collections import defaultdict from heapq import heappush, heappop import math def dijkstra(adjacency_list, source_id, target_id): """ To be implemented by students. `adjacency_list` is a dictionary with structure: {node_id: [...(neighbor_id, weight)]}. Function should return (distance, path). Path should be a list of the nodes in the shortest path **including** the source_id and target_id. If no shortest path is found, it should return (infinity, []) """ return math.inf, [source_id] if __name__ == '__main__': try: Graph.test_dijkstra(dijkstra) print('Passed ALL tests!') except AssertionError: print('Failed one or more tests')