.. _cpp-ordered_graph: ********************************************************** ordered_graph.hpp ********************************************************** Full path: ``graph_canon/ordered_graph.hpp`` .. default-domain:: cpp .. default-role:: cpp:expr .. cpp:namespace:: graph_canon .. class:: template \ ordered_graph A graph adaptor that ensures iteration order in correspondence with a given vertex index map. Requires `Graph` to model a `VertexListGraph` and an `IncidenceGraph`, and `IndexMap` a `ReadableProperyMap`. The ordered graph models those concepts as well as `AdjacencyGraph`. If `WithInEdges` is `true`, and `Graph` models a `BidirectionalGraph`, then the ordered graph will model the `BidirectionalGraph` concept as well. When iterating through the range of vertices, adjacency vertices, and inverse-adjacent vertices, the vertices will appear in sorted order with respect to the given index map. When iterating through out-edges and in-edges, the edges will appear in sorted order with respect to the index of the neighbouring vertices. If the adapted graph has parallel edges, those will be ordered according to a predicate given to the constructor. .. type:: Graph = GraphT The type of the underlying graph. .. type:: IndexMap = IndexMapT The type of the vertex index map representing the order to use for iteration. .. function:: template \ ordered_graph(const Graph &g, IndexMap idx, EdgeLess edge_less) Construct an ordered graph from a graph and a given index map (the graph is stored by reference). The binary edge predicate `edge_less` is used when the graph has parallel edges (hint: give `always_false()` for simple graphs). .. function:: const Graph &get_graph() const :returns: a reference to the adapted graph. .. function:: IndexMap get_index_map() const :returns: a copy of the stored index map. .. function:: template \ ordered_graph make_ordered_graph(const Graph &g, IndexMap idx, EdgeLess edge_less) :returns: `ordered_graph(g, idx, edge_less)`