The module altgraph.GraphUtil performs a number of more or less useful utility functions.
Generates and returns a Graph instance with node_num nodes randomly connected by edge_num edges.
When self_loops is present and True there can be edges that point from a node to itself.
When multi_edge is present and True there can be duplicate edges.
This method raises GraphError <altgraph.GraphError when a graph with the requested configuration cannot be created.
Generates and returns a Graph instance that will have steps*growth_n um nodes and a scale free (powerlaw) connectivity.
Starting with a fully connected graph with growth_num nodes at every step growth_num nodes are added to the graph and are connected to existing nodes with a probability proportional to the degree of these existing nodes.
Warning
The current implementation is basically untested, although code inspection seems to indicate an implementation that is consistent with the description at Wolfram MathWorld
Perform a depth-first oder walk of the graph starting at head and apply all filter functions in filters on the node data of the nodes found.
Returns (visited, removes, orphans), where