GAPI provides the application developer with an impressive array of facilities for managing and drawing graphs. The full set of methods of GAPI is given in the reference guide. The purpose of this tutorial is to quickly allow the user to handle the basic features of GAPI.

The available methods have clear names and are easy to use. For example, if you have to construct a new graph, simply use the primitives that the class undi_graph puts at disposal of the programmer to insert nodes and edges (new_node and new_edge). If some edges are directed give to them the desired direction (make_directed). Namely, suppose that you want to create a graph with four nodes (labeled 1,2,3,and 4) and four edges ((1,2),(1,3),(1,4),(2,3)).

Erasing a node or an edge is also very simple. For example, if you want to delete vertex v2, you can do: Identifiers associated to nodes and edges can be changed. Of course, collisions with existing identifiers must be avoided. When you create a node or an edge, if you do not specify an identifier, then the system automatically selects a non-already-used identifier and associetes it to the new object.

The full set of methods of the classes of GAPI are given in the reference guide. They are grouped into types. We distinguish among constructors and operators, access methods, update methods, and input/output methods.

Last update : July 31, 2002
Website design by INTEGRA Sistemi,