Skip to content

Commit 199db30

Browse files
author
Ajmera, Mahita SI/HZR-IDSA
committed
editing doctest
1 parent e1ad21c commit 199db30

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

graphs/graphs_floyd_warshall.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,13 @@ def floyd_warshall(graph, v):
3939
... [float('inf'), float('inf'), float('inf')],
4040
... [float('inf'), float('inf'), float('inf')]
4141
... ]
42-
>>> for i in range(num_vertices):
43-
... graph[i][i] = 0.0
44-
>>> graph[0][1] = 2
45-
>>> graph[1][0] = 1
42+
4643
>>> expected = [
4744
... [0, 2, float('inf')],
4845
... [1, 0, float('inf')],
4946
... [float('inf'), float('inf'), 0]
5047
... ]
5148
>>> dist, _ = floyd_warshall(graph, num_vertices)
52-
5349
The shortest path matrix using Floyd Warshall algorithm
5450
5551
0 2 INF

0 commit comments

Comments
 (0)