C++ Boost

transpose_graph

Graphs: directed (and not undirected)
Properties: vertex index
Complexity: O(V + E)

(1)
template <class VertexListGraph, class MutableGraph> 
void transpose_graph(const VertexListGraph& G, MutableGraph& G_T);

(2)
template <class VertexListGraph, class MutableGraph, class VertexIndexMap> 
void transpose_graph(const VertexListGraph& G, MutableGraph& G_T, 
                     VertexIndexMap index);

This function computes the transpose of a directed graph. The transpose of a directed graph G = (V, E)is the graph GT = (V, ET) , where ET = {(v, u) in V x V: (u, v) in E} . i.e., GT is G with all its edges reversed. Graph G_T passed into the algorithm must have the same number of vertices as G and no edges. The edges will be added by transpose_graph() by calling add_edge as follows for each edge (u,v) in G:

add_edge(vertex(get(index, v), G_T), vertex(get(index, u), G_T), G_T);

Where Defined

boost/graph/transpose_graph.hpp

Requirements on Types

Complexity

The time complexity is O(V + E).


Copyright © 2000 Jeremy Siek, Univ.of Notre Dame (jsiek@lsc.nd.edu)