mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-09-20 07:43:04 +08:00
explanation updated
This commit is contained in:
parent
4548296aff
commit
196f0185f9
@ -8,7 +8,7 @@ export default function bellmanFord(graph, startVertex) {
|
||||
const previousVertices = {};
|
||||
|
||||
// Init all distances with infinity assuming that currently we can't reach
|
||||
// any of the vertices except start one.
|
||||
// any of the vertices except start one and try to get to that point.
|
||||
distances[startVertex.getKey()] = 0;
|
||||
graph.getAllVertices().forEach((vertex) => {
|
||||
previousVertices[vertex.getKey()] = null;
|
||||
|
Loading…
Reference in New Issue
Block a user