Visualizing complex structures using Graphviz
|
Drawing Paths
Sometimes a certain path is interesting in a graph, such as the shortest path between two points – as in planning a road trip. Usually edges get additional properties, like distances, road conditions, obstacles, or traffic jams. All of these factors contribute to evaluating a route.
Figure 7 shows a relatively simple example of such a path of a graph. The red color and changing width of the line are done using the color and penwidth attributes.
To get a uniform hexagon, use the command circo when translating Listing 6 – all the other elements in the call remain the same.
Listing 6
Draw a Path
01 graph { 02 a -- b -- d -- c -- f[color=red,penwidth=3.0]; 03 b -- c; 04 d -- e; 05 e -- f; 06 a -- d; 07 }
Dot Viewer
Apart from the rather antiquated dotty viewer program included in the Graphviz package, some research in the web will yield Smyrna [10] and ZGRViewer [11] among others.
The former has an "experimental" status, but it shows some promise based on the documentation. ZGRViewer is based on Java program code that so far has not been available for Debian or Ubuntu as a package.
« Previous 1 2 3 4 Next »
Buy this article as PDF
Pages: 4
(incl. VAT)