Compare commits

...

3 Commits

Author SHA1 Message Date
jatin0004
3c6ed0aa09
Merge 42b00c3363 into 2c67b48c21 2024-04-25 08:26:43 +08:00
jatin0004
42b00c3363
mst explain 2021-10-13 01:43:57 +05:30
jatin0004
196f0185f9
explanation updated 2021-10-13 01:40:45 +05:30
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -1,7 +1,7 @@
# Prim's Algorithm
In computer science, **Prim's algorithm** is a greedy algorithm that
finds a minimum spanning tree for a weighted undirected graph.
finds a minimum spanning tree(shortest distance to reach every node) for a weighted undirected graph.
The algorithm operates by building this tree one vertex at a
time, from an arbitrary starting vertex, at each step adding