= 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

WARNING: `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

[source,cpp]
----
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

[source,cpp]
----
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

[cols="1,3,1",options="header"]
|===
| Parameter | Description | Default

| `EdgeIterator`
| Must model InputIterator. `value_type` must be a pair of vertex descriptors.
|

| `ValueType`
| The `value_type` of `EdgeIterator`.
| `std::iterator_traits<EdgeIterator>::value_type`

| `DiffType`
| The `difference_type` of `EdgeIterator`.
| `std::iterator_traits<EdgeIterator>::difference_type`
|===

== Member Functions

[source,cpp]
----
edge_list(EdgeIterator first, EdgeIterator last);
----

Create a graph from the edge range `[first, last)`.

== Non-Member Functions

[source,cpp]
----
std::pair<edge_iterator, edge_iterator>
edges(const edge_list& g);
----

Returns an iterator-range for the edge set.

'''

[source,cpp]
----
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`.

== Associated Types

[cols="1,3",options="header"]
|===
| Type | Description

| `vertex_descriptor`
| Same as `std::iterator_traits<EdgeIterator>::value_type::first_type`.

| `edge_descriptor`
| Internal edge descriptor type.

| `edge_iterator`
| Same iterator category as `EdgeIterator`.
|===
