02.10.2012 Views

5 Graph Description Language (GDL) - Absint

5 Graph Description Language (GDL) - Absint

5 Graph Description Language (GDL) - Absint

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.4 Hierarchical Layout<br />

6.4.1 Rank Assignment<br />

After folding, all the visible nodes are determined. If all the visible nodes have been specified by<br />

the user using valid coordinates, the graph is drawn immediately. However, if the coordinates of<br />

at least one node are missing, an appropriate layout has to be calculated. The first pass places the<br />

nodes in discrete ranks. All nodes of the same rank appear at the same vertical position.<br />

There are many possibilities for assigning rank. The normal method is to calculate a spanning<br />

tree by determining the strongly connected components of the graph. All edges should be oriented<br />

top-down. A heuristic tries to find a minimum set of edges that cannot be oriented top-down.<br />

A faster method is to calculate the spanning tree of a graph by depth first search (DFS). However,<br />

the order in which the nodes are visited has a substantial influence on the layout. The initial order<br />

of the nodes is the order given by the graph specification. aiSee offers various versions of such<br />

methods:<br />

• dfs:<br />

Calculates the spanning tree by one single DFS traversal. This is the fastest method, but the<br />

quality of the result might be poor for some graphs.<br />

• maxdepth:<br />

Calculates the spanning tree by DFS using the initial order and the reverted initial order,<br />

followed by choosing the deepest spanning tree. This results in more levels, i.e. the graph is<br />

larger in the y direction.<br />

• mindepth:<br />

Takes the flatter spanning tree of both DFS’s. This results in fewer levels, or more nodes at<br />

the same levels, meaning the graph is larger in the x direction.<br />

• maxdepthslow, mindepthslow:<br />

Whereas the above algorithms are fast heuristics for increasing or decreasing the depth of<br />

the layout, maxdepthslow and mindepthslow actually calculate a good order so as to obtain<br />

a maximum or minimum spanning tree. However, they pose one disadvantage: they are<br />

rather slow. Warning: A minimum spanning tree does not necessarily mean that the depth<br />

of the layout is minimal. However, good heuristics involves obtaining a flat layout (see the<br />

examples on p. 53).<br />

• maxdegree, mindegree, maxindegree, minindegree<br />

maxoutdegree, minoutdegree:<br />

These algorithms combine DFS with node sorting. The sorting criteria are the number of<br />

incoming edges, the number of outgoing edges, and the number of edges all at the same<br />

node. Node sorting may have various effects and can sometimes be used as a fast alternative<br />

to maxdepthslow or mindepthslow.<br />

• minbackward:<br />

Instead of calculating strongly connected components, aiSee can also perform topological<br />

117

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!