egonSchiele / grokking_algorithms

Code for the book Grokking Algorithms (https://amzn.to/29rVyHf)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem regarding Dijkstra's algorithm with changed values

sleipnir029 opened this issue · comments

For the given graph, when I changed the values of A and B, where A < B. I don't get the desired path.
Here's the link to the code. I have checked for negative-weight edges and found none. I have also implemented a function that shows the final path.

Result for the given graph:
firstprint

Result with changed values
secondprint