graph_tool.generation
#
This module contains functions that generate different kinds of graphs.
Random graph generation#
Generate a random graph, with a given degree distribution and (optionally) vertex-vertex correlation. |
|
Shuffle the graph in-place, following a variety of possible statistical models, chosen via the parameter |
|
Add new edges to a graph, chosen uniformly at random. |
|
Remove edges from the graph, chosen uniformly at random. |
|
Closes open triads in a graph, according to an ego-based process. |
|
A generalized version of Price's --- or Barabási-Albert if undirected --- preferential attachment network model. |
Stochastic block models#
Generate a random graph by sampling from the Poisson or microcanonical stochastic block model. |
|
Generate a random graph by sampling from the maximum-entropy "canonical" stochastic block model. |
|
Obtain SBM fugacities, given expected degrees and edge counts between groups. |
Geometric models#
Generate a graph of k-nearest neighbors (or pairs) from a set of multidimensional points. |
|
Generate a geometric network form a set of N-dimensional points. |
|
Generate a 2D or 3D triangulation graph from a given point set. |
Graph transformations#
Return a graph from a list of predecessors given by the |
|
Return the line graph of the given graph g. |
|
Obtain the condensation graph, where each vertex with the same 'prop' value is condensed in one vertex. |
|
Contract all parallel edges into simple edges. |
|
Remove all parallel edges from the graph. |
|
Expand edge multiplicities into parallel edges. |
|
Label edges which are parallel, i.e, have the same source and target vertices. |
|
Remove all self-loops edges from the graph. |
|
Label edges which are self-loops, i.e, the source and target vertices are the same. |
Graph operations#
Return the union of graphs |
Deterministic graphs#
Generate a N-dimensional square lattice. |
|
Generate complete graph. |
|
Generate a circular graph. |