vietphi
0
Q:

networkx astar_path define the heuristic

def distance(a,b):
    return ( nx.dijkstra_path_length(G,a,b, 'day') + len(nx.dijkstra_path(G, a, b)) )

nx.astar_path_length(G, 'A', 'F', heuristic=distance, weight='day')
0

New to Communities?

Join the community