Graph
The Graph concept contains a few requirements that are common to all the
graph concepts. These include some associated types for
vertex_descriptor, edge_descriptor, etc. One should note
that a model of Graph is not required to be a model of
Assignable, so algorithms should pass graph objects by reference.
Associated Types
A vertex descriptor corresponds to a unique vertex in an abstract graph instance. A vertex descriptor must be Default Constructible, Assignable, and Equality Comparable. |
An edge descriptor corresponds to a unique edge (u,v) in a graph. An edge descriptor must be Default Constructible, Assignable, and Equality Comparable. |
This type shall be convertible to |
This describes whether the graph class allows the insertion of parallel
edges (edges with the same source and target). The two tags are
|
This describes the ways in which the vertices and edges of the graph can
be visited. The choices are |
Valid Expressions
boost::graph_traits<G>::null_vertex()
Returns a special
boost::graph_traits<G>::vertex_descriptor object which
does not refer to any vertex of graph object which type is G.
Concept Checking Class
template <class G>
struct GraphConcept
{
typedef typename boost::graph_traits<G>::vertex_descriptor vertex_descriptor;
typedef typename boost::graph_traits<G>::edge_descriptor edge_descriptor;
typedef typename boost::graph_traits<G>::directed_category directed_category;
typedef typename boost::graph_traits<G>::edge_parallel_category edge_parallel_category;
typedef typename boost::graph_traits<G>::traversal_category traversal_category;
void constraints() {
BOOST_CONCEPT_ASSERT(( DefaultConstructibleConcept<vertex_descriptor> ));
BOOST_CONCEPT_ASSERT(( EqualityComparableConcept<vertex_descriptor> ));
BOOST_CONCEPT_ASSERT(( AssignableConcept<vertex_descriptor> ));
BOOST_CONCEPT_ASSERT(( DefaultConstructibleConcept<edge_descriptor> ));
BOOST_CONCEPT_ASSERT(( EqualityComparableConcept<edge_descriptor> ));
BOOST_CONCEPT_ASSERT(( AssignableConcept<edge_descriptor> ));
}
G g;
};