mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-10 11:09:43 +08:00
¨a¨
This commit is contained in:
parent
ca3d16dcce
commit
4d64921e7c
@ -7,7 +7,7 @@ export default function bellmanFord(graph, startVertex) {
|
|||||||
const distances = {};
|
const distances = {};
|
||||||
const previousVertices = {};
|
const previousVertices = {};
|
||||||
|
|
||||||
// Init all distances with infinity assuming that currently we can't reach
|
// 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.
|
||||||
distances[startVertex.getKey()] = 0;
|
distances[startVertex.getKey()] = 0;
|
||||||
graph.getAllVertices().forEach((vertex) => {
|
graph.getAllVertices().forEach((vertex) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user