0

I am implementing dijkstra with weight for directed graph :-

path=nx.dijkstra_path(G, 1, 4, weight='weight')

When I print computed path it shows following:-

Computed weighted dijkstra path is: [1, 2, 3, 4]
Computed weighted dijkstra path is: [4, 3, 2, 1] 

Is it normal that reverse path is computed as well. I was only expecting forward path. Why this is happening?

Additionally in mininet after some time it again prints computed path althought I have not issued any more command. There was only one iperf command b/w 2 hosts.

Could anyone please explain these 2 issues for me.

CobaltRed
  • 37
  • 6
  • Can you show your full code (graph definition, plus whatever is printing out those statements)? You should always include enough information for people to try to reproduce what you are doing. – baileythegreen Apr 08 '22 at 17:26
  • Does it do this with other graphs or just **G**? Its impossible to debug without seeing more of the code. Could you reproduce the issue without sharing the graph? – DrBwts Apr 08 '22 at 17:36
  • Hi. I cannot post full code due to confidentiality issues. But if it helps here is some more details- Graph is bi-directed so there are weights in each direction. There is mininet topology and I am trying to find shortest path b/w two nodes. Controller asks for stats from switch every second. It's happening with other graphs as well. I dont understand why its producing reverse path as well? – CobaltRed Apr 08 '22 at 17:47
  • Can you explain your question a bit more? You want people to explain your code without actually seeing the code in question? – kenntnisse Apr 08 '22 at 17:55
  • what controller are you using? I think your question may relate more to the controller than to Mininet. – Hasan Aga Apr 09 '22 at 00:17
  • @HasanAli I am working with Ryu. – CobaltRed Apr 10 '22 at 19:10

0 Answers0