@@ -0,0 +1,2176 @@
+%22%22%22DOES NOT WORK%22%22%22%0Afrom Queue import PriorityQueue%0A# from weighted_graph import Wgraph%0A%0A%0Adef dijkstra(weighted_graph, start, end):%0A    dict_node_totalweight = %7B%7D%0A    dict_node_totalweight%5Bstart%5D = 0%0A    prev = %5B%5D%0A    pq = PriorityQueue()%0A    for node in weighted_graph.nodes():%0A        if node is not start:%0A            dict_node_totalweight%5Bnode%5D = float(%22inf%22)%0A        pq.put((float(%22inf%22), node))%0A%0A    while pq:%0A        temp = pq.get()%0A        if temp%5B1%5D == end:%0A            break%0A        for neighbor in weighted_graph.neighbors(temp%5B1%5D):%0A            alt = temp%5B0%5D + weighted_graph.dict%5Btemp%5B1%5D%5D%5Bneighbor%5D%0A            if alt %3C dict_node_totalweight%5Bneighbor%5D:%0A                dict_node_totalweight%5Bneighbor%5D = alt%0A                prev.append(temp%5B0%5D)%0A                pq.put(alt, neighbor)%0A    print 'prev: %7B%7D'.format(prev)%0A    return prev%0A%0A%0A%0A    # list_of_tuples_node_totalweight = %5B%5D%0A    # list_of_tuples_node_totalweight.append((start, 0))%0A    # # weight_dict%5Bstart%5D = 0          # total weight/distance%0A    # prev = %5B%5D         # previous node%0A    # # unvisited = %5B%5D%0A%0A    # for node in weighted_graph.nodes():%0A    #     if node is not start:%0A    #         list_of_tuples_node_totalweight.append(node, float(%22inf%22))%0A    #     unvisited = list_of_tuples_node_totalweight%0A%0A    # while unvisited:%0A    #     sorted_list = sorted(unvisited, key=lambda x: x%5B1%5D)%0A    #     temp = sorted_list%5B0%5D%0A    #     unvisited = sorted_list%5B1:%5D%0A%0A    #     for neighbor in temp.neighbors():%0A    #         alt = temp%5B1%5D + weighted_graph%5Btemp%5B0%5D%5D%5Bneighbor%5D%0A    #         if alt %3C list_of_tuples_node_totalweight%5Bneighbor%5D%5B1%5D:%0A    #             list_of_tuples_node_totalweight%5Bneighbor%5D%5B1%5D = alt%0A    #             prev.append(neighbor)%0A    #             if temp == end:%0A    #                 break%0A    # return list_of_tuples_node_totalweight, prev%0A%0A%0A%0A    # # already_visited = %5Bstart%5D%0A    # # for node in weighted_graph:%0A    # #     if node is not start:%0A    # #         weight = 100%0A    # #         # previous = undefined%0A    # #     pq = Pq.insert(node, weight)%0A%0A    # # while Pq:%0A    # #     temp = pq.pop()%0A    # #     for neighbor in weighted_graph.neighbors(temp):%0A    # #         alt =

Add pq method.