template <class VertexListGraph, class MutableGraph> void transpose_graph(const VertexListGraph& G, MutableGraph& G_T, const bgl_named_params<P, T, R>& params = all defaults)
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 no vertices and no edges. The vertices and edges will be added by transpose_graph() by calling add_vertex and add_edge as follows for each edge (u,v) in G.
boost/graph/transpose_graph.hpp
A directed graph. The graph type must be a model of Vertex List Graph.OUT: const MutableGraph& G_T
The transposed graph. The graph type must be a model of Mutable Graph.
This is a Binary Function that copies the properties of a vertex in the original graph into the corresponding vertex in the copy.IN: edge_copy(EdgeCopier ec)
Default: vertex_copier<VertexListGraph, MutableGraph> which uses the property tag vertex_all to access a property map from the graph.
This is a Binary Function that copies the properties of an edge in the original graph into the corresponding edge in the copy.IN: vertex_index_map(VertexIndexMap i_map)
Default: edge_copier<VertexListGraph, MutableGraph> which uses the property tag edge_all to access a property map from the graph.
The vertex index map type must be a model of Readable Property Map and must map the vertex descriptors of G to the integers from 0 to num_vertices(G).UTIL/OUT: orig_to_copy(Orig2CopyMap c)
Default: get(vertex_index, G)
This maps vertices in the original graph to vertices in the copy. Default: an iterator_property_map created from a std::vector of the output graph's vertex descriptor type of size num_vertices(g) and using the i_map for the index map.
The time complexity is O(V + E).
Copyright © 2000-2001 | Jeremy Siek, Indiana University (jsiek@osl.iu.edu) |