MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / min_dist

Function min_dist

graphs/dijkstra_2.py:11–18  ·  view source on GitHub ↗
(mdist, vset, v)

Source from the content-addressed store, hash-verified

9
10
11def min_dist(mdist, vset, v):
12 min_val = float("inf")
13 min_ind = -1
14 for i in range(v):
15 if (not vset[i]) and mdist[i] < min_val:
16 min_ind = i
17 min_val = mdist[i]
18 return min_ind
19
20
21def dijkstra(graph, v, src):

Callers 1

dijkstraFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected