def getDistances(digraph, path):
    """Returns total & outdoor distances for given path."""
    total_dist = 0
    outdoor_dist = 0
    for i in range(len(path) - 1):
        for node, edge in digraph.edges[path[i]]:
            if node == path[i + 1]:
                total_dist += edge.getTotalDistance()
                outdoor_dist += edge.getOutdoorDistance()
    return (total_dist, outdoor_dist)