EdgeListGraph
The EdgeListGraph concept refines the Graph
concept, and adds the requirement for efficient access to all the
edges in the graph.
Refinement of
Graph
Associated Types
| Edge Iterator Type |
boost::graph_traits<G>::edge_iterator |
An edge iterator (obtained via edges(g)) provides access to
all of the edges in a graph. An edge iterator type must meet the
requirements of MultiPassInputIterator. The
value type of the edge iterator must be the same as the edge
descriptor of the graph.
|
| Edges Size Type |
boost::graph_traits<G>::edges_size_type |
The unsigned integer type used to represent the number of edges
in the graph.
|
Valid Expressions
| Edge Set of the Graph |
edges(g) |
std::pair<edge_iterator, edge_iterator> |
Returns an iterator-range providing access to all
the edges in the graph g. |
| Number of Edges in the Graph |
num_edges(g) |
edges_size_type |
Returns the number of edges in the graph g. |
| Source Vertex of an Edge |
source(e, g) |
vertex_descriptor |
Returns the vertex descriptor for u of the edge (u,v)
represented by e.
|
| Target Vertex of an Edge |
target(e, g) |
vertex_descriptor |
Returns the vertex descriptor for
v of the edge (u,v) represented by e.
|
Models
Complexity guarantees
The edges(), source(), and target() functions
must all return in constant time.
See Also
Graph concepts
Concept Checking Class
template <class G>
struct EdgeListGraph_concept
{
typedef typename boost::graph_traits<G>::edge_iterator
edge_iterator;
void constraints() {
REQUIRE(G, Graph);
REQUIRE(edge_iterator, MultiPassInputIterator);
p = edges(g);
E = num_edges(g);
e = *p.first;
u = source(e, g);
v = target(e, g);
const_constraints(g);
}
void const_constraints(const G& g) {
p = edges(g);
E = num_edges(g);
e = *p.first;
u = source(e, g);
v = target(e, g);
}
std::pair<edge_iterator,edge_iterator> p;
typename boost::graph_traits<G>::vertex_descriptor u, v;
typename boost::graph_traits<G>::edge_descriptor e;
typename boost::graph_traits<G>::edges_size_type E;
G g;
};