DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
The C++ Graph Classes: A Tutorial - Graph(C++) and Graph_alg(C++)

Graph Information Retrieval

Most Graph applications require the ability to retrieve Graph information. The following Graph member functions are defined for both the generic and user-derived Graph types:

       const Set_of_p<Edge>& edges() const;
           // all Edges in the Graph
       const Set_of_p<Vertex>& vertices() const;
           // all Vertices in the Graph
       int contains(const Vertex* v) const;
           // Is v in the Graph?
       int contains(const Edge* e) const;
           // Is e in the Graph?

Then, for a Graph g and Vertex v1, the following operations are legal:

       Set_of_p<Edge> eset = g.edges();// g is a previously
                                       // declared Graph
       if (g.contains(&v1)) ... ; // returns true if
                                  // g contains v1
       etc.

Next topic: Graph Subgraph Creation
Previous topic: Graph Component Insertion and Removal

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005