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

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

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004