graph_tool.topology
#
This module contains various functions that assess the graph topology.
Distance and paths#
Calculate the distance from a source to a target vertex, or to of all vertices from a given source, or the all pairs shortest paths, if the source is not specified. |
|
Return the shortest path from |
|
Return a random shortest path from source to target, uniformly sampled from all paths of equal length. |
|
Return the number of shortest paths from source to target. |
|
Return an iterator over all shortest paths from source to target. |
|
Return a property map with all possible predecessors in the search tree determined by |
|
Return an iterator over all paths from source to target. |
|
Return an iterator over all the cycles in a directed graph. |
|
Compute the pseudo-diameter of the graph. |
Graph comparison#
Return the Jaccard adjacency similarity between two graphs. |
|
Return the similarity between pairs of vertices. |
|
Check whether two graphs are isomorphic. |
|
Obtain all subgraph isomorphisms of sub in g (or at most max_n subgraphs, if max_n > 0). |
|
Mark a given subgraph sub on the graph g. |
|
Return an iterator over the maximal cliques of the graph. |
Matching and independent sets#
Find a maximum cardinality matching in the graph. |
|
Find a maximal independent vertex set in the graph. |
Spanning tree#
Return the minimum spanning tree of a given graph. |
|
Return a random spanning tree of a given graph, which can be directed or undirected. |
Sorting and closure#
Return a vertex property map the dominator vertices for each vertex. |
|
Return the topological sort of the given graph. |
|
Return the transitive closure graph of g. |
Components and connectivity#
Label the components to which each vertex in the graph belongs. |
|
Label the edges of biconnected components, and the vertices which are articulation points. |
|
Label the largest component in the graph. |
|
Extract the largest (strong) component in the graph as a |
|
Label the out-component (or simply the component for undirected graphs) of a root vertex. |
|
Compute the size of the largest or second-largest component as vertices are (virtually) removed from the graph. |
|
Compute the size of the largest or second-largest component as edges are (virtually) removed from the graph. |
|
Perform a k-core decomposition of the given graph. |
Graph classification#
Test if the graph is bipartite. |
|
Return True if the graph is a directed acyclic graph (DAG). |
|
Test if the graph is planar. |
|
Add edges to the graph to make it maximally planar. |
Directionality#
Calculate the edge reciprocity of the graph. |
Combinatorial optimizaton#
Return a traveling salesman tour of the graph, which is guaranteed to be twice as long as the optimal tour in the worst case. |
|
Returns a vertex coloring of the graph. |