You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, I've noticed, the comment is incorrect. We do not do relaxation for each "almost" each vertex: "V-1" but we do relaxation
V - 1 times. Period. So to express it in the code we can iterate over "i" not "v" to show it. Minor issue.
Is your optimization with variable 'relaxedAnEdge' always true? It seems to be invalid for me as some paths can not be relaxed, during processing of unordered set of edges (we have set of edges in reality - without specific point of start and algorithm will work anyway) but other, later on, can. What do you thing about that?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi William :-)
Good stuff on youtube :-) Thanks.
https://github.com/williamfiset/Algorithms/blob/master/src/main/java/com/williamfiset/algorithms/graphtheory/BellmanFordEdgeList.java
Lines 44-45:
Remarks:
V - 1 times. Period. So to express it in the code we can iterate over "i" not "v" to show it. Minor issue.
robertospara at gmail.com
Beta Was this translation helpful? Give feedback.
All reactions