Hello,
I have created a simple graph by using a distance matrix.
Below you can find the code.
from dijkstar import Graph, find_path
matrix = ...... (distance matrix is created here)
graph = Graph()
for i in range(size):
for j in range(size):
graph.add_edge(i, j, {'cost': matrix[i][j]})
cost_func = lambda u, v, e, prev_e: e['cost']
path = find_path(graph, 0, 6, cost_func=cost_func)
path
My question is, how am I able to learn the details of the founded path. There is a total cost, but I want to learn with which order of nodes I will get this cost. I want to learn the optimal order of nodes.
Thank you.
Hello,
I have created a simple graph by using a distance matrix.
Below you can find the code.
My question is, how am I able to learn the details of the founded path. There is a total cost, but I want to learn with which order of nodes I will get this cost. I want to learn the optimal order of nodes.
Thank you.