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

Function _print_dist

graphs/graphs_floyd_warshall.py:8–16  ·  view source on GitHub ↗
(dist, v)

Source from the content-addressed store, hash-verified

6
7
8def _print_dist(dist, v):
9 print("\nThe shortest path matrix using Floyd Warshall algorithm\n")
10 for i in range(v):
11 for j in range(v):
12 if dist[i][j] != float("inf"):
13 print(int(dist[i][j]), end="\t")
14 else:
15 print("INF", end="\t")
16 print()
17
18
19def floyd_warshall(graph, v):

Callers 1

floyd_warshallFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected