GAPI provides several visibility layout algorithms. If you want to construct a standard visibility representation of a graph with GAPI, simply do the following:

Observe that if you have strict aesthetics requirements, you can replace
   draw_undi_graph dug(pug, VISIBILITY);
with
   draw_undi_graph dug(pug, VISIBILITY_COMPACTED);
in order to reduce the total edge-length of the drawing.

Note: the current version of GDT allows to apply option VISIBILITY only to graphs that are biconnected. A graph is biconnected if the removal of one node is not sufficient to cut it into two (or more) disconnected pieces.

An example of a visibilty representation drawn with GAPI is shown in the following figure:

 

To draw directed graphs, GAPI offers an "upward-visibility" layout model. For more details, you can see the GAPI reference. An example of an upward-visibility drawing with a cross, is shown in the next figure:

 


Last update : July 31, 2002
Website design by INTEGRA Sistemi, www.IntegraSistemi.it