easygraph.functions.path.path module#
- easygraph.functions.path.path.Dijkstra(G, node, weight='weight')[source]#
Returns the length of paths from the certain node to remaining nodes
- Parameters:
G (graph) – weighted graph
node (int) –
- Returns:
result_dict – the length of paths from the certain node to remaining nodes
- Return type:
dict
Examples
Returns the length of paths from node 1 to remaining nodes
>>> Dijkstra(G,node=1,weight="weight")
- easygraph.functions.path.path.Floyd(G, weight='weight')[source]#
Returns the length of paths from all nodes to remaining nodes
- Parameters:
G (graph) – weighted graph
- Returns:
result_dict – the length of paths from all nodes to remaining nodes
- Return type:
dict
Examples
Returns the length of paths from all nodes to remaining nodes
>>> Floyd(G,weight="weight")
- easygraph.functions.path.path.Kruskal(G, weight='weight')[source]#
Returns the edges that make up the minimum spanning tree
- Parameters:
G (graph) – weighted graph
- Returns:
result_dict – the edges that make up the minimum spanning tree
- Return type:
dict
Examples
Returns the edges that make up the minimum spanning tree
>>> Kruskal(G,weight="weight")
- easygraph.functions.path.path.Prim(G, weight='weight')[source]#
Returns the edges that make up the minimum spanning tree
- Parameters:
G (graph) – weighted graph
- Returns:
result_dict – the edges that make up the minimum spanning tree
- Return type:
dict
Examples
Returns the edges that make up the minimum spanning tree
>>> Prim(G,weight="weight")