Code for the book Grokking Algorithms (https://amzn.to/29rVyHf)
Geek Repo:Geek Repo
Github PK Tool:Github PK Tool
nazjude opened this issue 4 years ago · comments
Hi, thanks for this great work,
Yes, negative weighted edge there in 7.1 C graph, but no negative cycle, right?
Thus we do have a shortest path from start to finish, whose weight is 4, true?
test code attached: 7.1_C.txt
version:
print(sys.version) 3.7.6 (default, Jan 8 2020, 20:19:54)
results: To update a -> b update a -> fin To To To check sequence: ['a', 'c', 'b', 'fin'] cost updatd: {'a': 2, 'c': 2, 'b': 4, 'fin': 4}