Edge List
Turns a pair of edge iterators into an EdgeListGraph. Minimal adaptor providing
only edges(), source(), and target().
Defined in: <boost/graph/edge_list.hpp>
Models: EdgeListGraph only
edge_list does not model VertexListGraph, IncidenceGraph, or
AdjacencyGraph. Most BGL algorithms (BFS, DFS, Dijkstra, etc.) cannot be used
with it. It works with algorithms that only need edge iteration, such as
bellman_ford_shortest_paths and kruskal_minimum_spanning_tree.
|
Example
enum { u, v, x, y, z, N };
char name[] = { 'u', 'v', 'x', 'y', 'z' };
using E = std::pair<int, int>;
E edges[] = { E(u,y), E(u,x), E(u,v),
E(v,u),
E(x,y), E(x,v),
E(y,v), E(y,z),
E(z,u), E(z,x) };
boost::edge_list<E*> g(edges, edges + 10);
Synopsis
template <typename EdgeIterator,
typename ValueType = std::iterator_traits<EdgeIterator>::value_type,
typename DiffType = std::iterator_traits<EdgeIterator>::difference_type>
class edge_list;
The value_type of the edge iterator must be a std::pair (or have first
and second members). Both members must be the same type, used as vertex
descriptors. The ValueType and DiffType parameters are only needed for
compilers without partial specialization support.
Template Parameters
| Parameter | Description | Default |
|---|---|---|
|
Must model InputIterator. |
|
|
The |
|
|
The |
|
Member Functions
edge_list(EdgeIterator first, EdgeIterator last);
Create a graph from the edge range [first, last).
Non-Member Functions
std::pair<edge_iterator, edge_iterator>
edges(const edge_list& g);
Returns an iterator-range for the edge set.
vertex_descriptor source(edge_descriptor e, const edge_list& g);
vertex_descriptor target(edge_descriptor e, const edge_list& g);
Returns the source/target vertex of edge e.