Package graph :: Module generators

Module generators

Random graph generators for python-graph.

Functions
 
generate(graph, num_nodes, num_edges, weight_range=(1, 1))
Add nodes and random edges to the graph.
Function Details

generate(graph, num_nodes, num_edges, weight_range=(1, 1))

 

Add nodes and random edges to the graph.

Parameters:
  • graph (graph) - Graph.
  • num_nodes (number) - Number of nodes.
  • num_edges (number) - Number of edges.
  • weight_range (tuple) - tuple of two integers as lower and upper limits on randomly generated weights (uniform distribution).