Querying Graphs

Similarly, functions that are queries for graphs, edges, and vertices return results that are, or that contain, pointers to appropriate objects. Also, most functions in Prg_Graph accept arguments that are pointers to objects of the three basic types defined above. For example, the following functions allow you to obtain the neighbors of a vertex, the edges of a vertex, the sets of connected vertices (partitions) in a graph, and the vertices attached to an edge, respectively:

As mentioned above, certain Prg_Graph functions return containers for a collection of entities, typically a collection of pointers to edges or vertices. These containers are called “vectors” and are supported by the Prg_Vector package. For example, the function prg_vertex_edges_get() returns a vector containing zero or more elements of type PrgT_Graph_Edge*.