'Returns a list of nodes connecting the two nodes.'

def shortest_path(self, node1, node2, heuristic=None, directed=False):

    if (not isinstance(node1, Node)):
        node1 = self[node1]
    if (not isinstance(node2, Node)):
        node2 = self[node2]
    try:
        p = dijkstra_shortest_path(self, node1.id, node2.id, heuristic, directed)
        p = [self[id] for id in p]
        return p
    except IndexError:
        return None
