7cdda931fd6e272529f25a4cd2dbd7c6785d467c,graphs/dijkstra_2.py,,,#,41

Before Change



//MAIN
V = int(input("Enter number of vertices: "))
E = int(input("Enter number of edges: "))

graph = [[float("inf") for i in range(V)] for j in range(V)]

for i in range(V):
	graph[i][i] = 0.0

for i in range(E):
	print("\nEdge ",i+1)
	src = int(input("Enter source:"))
	dst = int(input("Enter destination:"))
	weight = float(input("Enter weight:"))
	graph[src][dst] = weight

After Change





if __name__ == "__main__":
    V = int(input("Enter number of vertices: ").strip())
    E = int(input("Enter number of edges: ").strip())

    graph = [[float("inf") for i in range(V)] for j in range(V)]

    for i in range(V):
	    graph[i][i] = 0.0

    for i in range(E):
	    print("\nEdge ",i+1)
	    src = int(input("Enter source:").strip())
	    dst = int(input("Enter destination:").strip())
	    weight = float(input("Enter weight:").strip())
	    graph[src][dst] = weight

    gsrc = int(input("\nEnter shortest path source:").strip())
    Dijkstra(graph, V, gsrc)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 12

Instances


Project Name: TheAlgorithms/Python
Commit Name: 7cdda931fd6e272529f25a4cd2dbd7c6785d467c
Time: 2019-07-16
Author: cclauss@me.com
File Name: graphs/dijkstra_2.py
Class Name:
Method Name:


Project Name: TheAlgorithms/Python
Commit Name: 7cdda931fd6e272529f25a4cd2dbd7c6785d467c
Time: 2019-07-16
Author: cclauss@me.com
File Name: graphs/bellman_ford.py
Class Name:
Method Name:


Project Name: TheAlgorithms/Python
Commit Name: 7cdda931fd6e272529f25a4cd2dbd7c6785d467c
Time: 2019-07-16
Author: cclauss@me.com
File Name: graphs/minimum_spanning_tree_prims.py
Class Name:
Method Name: