Layered graph drawing

From HandWiki
Short description: Graph drawing with vertices in horizontal layers
A layered drawing of a directed acyclic graph produced by Graphviz

Layered graph drawing or hierarchical graph drawing is a type of graph drawing in which the vertices of a directed graph are drawn in horizontal rows or layers with the edges generally directed downwards.Cite error: Closing </ref> missing for <ref> tag[1][2] The exact solution to this problem can be formulated using integer programming.[3] Alternatively, if the number of reversed edges is very small, these edges can be found by a fixed-parameter-tractable algorithm.[4]

  • The vertices of the directed acyclic graph resulting from the first step are assigned to layers, such that each edge goes from a higher layer to a lower layer. The goals of this stage are to simultaneously produce a small number of layers, few edges that span large numbers of layers, and a balanced assignment of vertices to layers.[5][6][3] For instance, by Mirsky's theorem, assigning vertices by layers according to the length of the longest path starting from each vertex produces an assignment with the minimum possible number of layers.[5][3] The Coffman–Graham algorithm may be used to find a layering with a predetermined limit on the number of vertices per layer and approximately minimizing the number of layers subject to that constraint.[5][6][3] Minimizing the width of the widest layer is NP-hard but may be solved by branch-and-cut or approximated heuristically.[3] Alternatively, the problem of minimizing the total number of layers spanned by the edges (without any limits on the number of vertices per layer) may be solved using linear programming.[7] Integer programming procedures, although more time-consuming, may be used to combine edge length minimization with limits on the number of vertices per level.[8]
  • Edges that span multiple layers are replaced by paths of dummy vertices so that, after this step, each edge in the expanded graph connects two vertices on adjacent layers of the drawing.[5][6]
  • As an optional step, a layer of edge concentrator vertices (or confluent junctions) may be imposed between two existing vertex layers, reducing the edge density by replacing complete bipartite subgraphs by stars through these edge concentrators.[3][9][10]
  • The vertices within each layer are permuted in an attempt to reduce the number of crossings among the edges connecting it to the previous layer.[5][6][3] Finding the minimum number of crossings or finding a maximum crossing-free set of edges is NP-complete, even when ordering a single layer at a time in this way,[11][12] so again it is typical to resort to heuristics, such as placing each vertex at a position determined by finding the average or median of the positions of its neighbors on the previous level and then swapping adjacent pairs as long as that improves the number of crossings.[5][6][7][12][13] Alternatively, the ordering of the vertices in one layer at a time may be chosen using an algorithm that is fixed-parameter tractable in the number of crossings between it and the previous layer.[3][14]
  • Each vertex is assigned a coordinate within its layer, consistent with the permutation calculated in the previous step.[5][6] Considerations in this step include placing dummy nodes on a line between their two neighbors to prevent unnecessary bends, and placing each vertex in a centered position with respect to its neighbors.[3] Sugiyama's original work proposed a quadratic programming formulation of this step; a later method of Brandes and Köpf takes linear time and guarantees at most two bends per edge.[3][15]
  • The edges reversed in the first step of the algorithm are returned to their original orientations, the dummy vertices are removed from the graph and the vertices and edges are drawn. To avoid intersections between vertices and edges, edges that span multiple layers of the drawing may be drawn as polygonal chains or spline curves passing through each of the positions assigned to the dummy vertices along the edge.[5][6][7]

Implementations

In its simplest form, layered graph drawing algorithms may require O(mn) time in graphs with n vertices and m edges, because of the large number of dummy vertices that may be created. However, for some variants of the algorithm, it is possible to simulate the effect of the dummy vertices without actually constructing them explicitly, leading to a near-linear time implementation.[16]

The "dot" tool in Graphviz produces layered drawings.[7] A layered graph drawing algorithm is also included in Microsoft Automatic Graph Layout[17] and in Tulip.[18]

Variations

Although typically drawn with vertices in rows and edges proceeding from top to bottom, layered graph drawing algorithms may instead be drawn with vertices in columns and edges proceeding from left to right.[19] The same algorithmic framework has also been applied to radial layouts in which the graphs are arranged in concentric circles around some starting node[3][20] and to three-dimensional layered drawings of graphs.[3][21]

In layered graph drawings with many long edges, edge clutter may be reduced by grouping sets of edges into bundles and routing them together through the same set of dummy vertices.[22] Similarly, for drawings with many edges crossing between pairs of consecutive layers, the edges in maximal bipartite subgraphs may be grouped into confluent bundles.[23]

Drawings in which the vertices are arranged in layers may be constructed by algorithms that do not follow Sugiyama's framework. For instance, it is possible to tell whether an undirected graph has a drawing with at most k crossings, using h layers, in an amount of time that is polynomial for any fixed choice of k and h, using the fact that the graphs that have drawings of this type have bounded pathwidth.[24]

For layered drawings of concept lattices, a hybrid approach combining Sugiyama's framework with additive methods (in which each vertex represents a set and the position of the vertex is a sum of vectors representing elements in the set) may be used. In this hybrid approach, the vertex permutation and coordinate assignment phases of the algorithm are replaced by a single phase in which the horizontal position of each vertex is chosen as a sum of scalars representing the elements for that vertex.[25] Layered graph drawing methods have also been used to provide an initial placement for force-directed graph drawing algorithms.[26]

References

  1. Eades, P.; Lin, X.; Smyth, W. F. (1993), "A fast and effective heuristic for the feedback arc set problem", Information Processing Letters 47 (6): 319–323, doi:10.1016/0020-0190(93)90079-O, http://researchrepository.murdoch.edu.au/id/eprint/27510/ .
  2. Eades, P.; Lin, X. (1995), "A new heuristic for the feedback arc set problem", Australian Journal of Combinatorics 12: 15–26 .
  3. 3.00 3.01 3.02 3.03 3.04 3.05 3.06 3.07 3.08 3.09 3.10 3.11 Cite error: Invalid <ref> tag; no text was provided for refs named hn14
  4. Chen, Jianer; Liu, Yang; Lu, Songjian; O'Sullivan, Barry; Razgon, Igor (2008), "A fixed-parameter algorithm for the directed feedback vertex set problem", Journal of the ACM 55 (5): 1, doi:10.1145/1411509.1411511 .
  5. 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 Cite error: Invalid <ref> tag; no text was provided for refs named dett98
  6. 6.0 6.1 6.2 6.3 6.4 6.5 6.6 Cite error: Invalid <ref> tag; no text was provided for refs named bm01
  7. 7.0 7.1 7.2 7.3 Gansner, E. R.; Koutsofios, E.; North, S. C.; Vo, K.-P. (1993), "A technique for drawing directed graphs", IEEE Transactions on Software Engineering 19 (3): 214–230, doi:10.1109/32.221135 .
  8. Healy, Patrick; Nikolov, Nikola S. (2002), "How to layer a directed acyclic graph", Graph Drawing: 9th International Symposium, GD 2001 Vienna, Austria, September 23–26, 2001, Revised Papers, Lecture Notes in Computer Science, 2265, Springer-Verlag, pp. 16–30, doi:10.1007/3-540-45848-4_2, ISBN 978-3-540-43309-5 .
  9. Newbery, F. J. (1989), "Edge concentration: a method for clustering directed graphs", Proceedings of the 2nd International Workshop on Software Configuration Management (SCM '89), Princeton, New Jersey, USA, Association for Computing Machinery, pp. 76–85, doi:10.1145/72910.73350, ISBN 0-89791-334-5 .
  10. "Confluent layered drawings", Lecture Notes in Computer Science, 47 (3383 ed.), Springer-Verlag, 2007, pp. 184–194, doi:10.1007/s00453-006-0159-8 .
  11. Eades, Peter; Whitesides, Sue (1994), "Drawing graphs in two layers", Theoretical Computer Science 131 (2): 361–374, doi:10.1016/0304-3975(94)90179-1 .
  12. 12.0 12.1 Eades, Peter; Wormald, Nicholas C. (1994), "Edge crossings in drawings of bipartite graphs", Algorithmica 11 (4): 379–403, doi:10.1007/BF01187020 .
  13. Mäkinen, E. (1990), "Experiments on drawing 2-level hierarchical graphs", International Journal of Computer Mathematics 36 (3–4): 175–181, doi:10.1080/00207169008803921 .
  14. "Fixed parameter algorithms for one-sided crossing minimization revisited", Journal of Discrete Algorithms 6 (2): 313–323, 2008, doi:10.1016/j.jda.2006.12.008 .
  15. "Fast and simple horizontal coordinate assignment", Graph drawing (Vienna, 2001), Lecture Notes in Computer Science, 2265, Berlin: Springer, 2002, pp. 31–44, doi:10.1007/3-540-45848-4_3, ISBN 978-3-540-43309-5 .
  16. Eiglsperger, Markus; Siebenhaller, Martin; Kaufmann, Michael (2005), "An efficient implementation of Sugiyama's algorithm for layered graph drawing", Graph Drawing, 12th International Symposium, GD 2004, New York, NY, USA, September 29-October 2, 2004, Revised Selected Papers, Lecture Notes in Computer Science, 3383, Springer-Verlag, pp. 155–166, doi:10.1007/978-3-540-31843-9_17, ISBN 978-3-540-24528-5 .
  17. Nachmanson, Lev; Robertson, George (2008), "Drawing Graphs with GLEE", Graph Drawing, 15th International Symposium, GD 2007, Sydney, Australia, September 24–26, 2007, Revised Papers, Lecture Notes in Computer Science, 4875, Springer-Verlag, pp. 389–394, doi:10.1007/978-3-540-77537-9_38, ISBN 978-3-540-77536-2, ftp://ftp.research.microsoft.com/pub/TR/TR-2007-72.pdf .
  18. Auber, David (2004), "Tulip – A Huge Graph Visualization Framework", in Jünger, Michael, Graph Drawing Software, Springer-Verlag, ISBN 978-3-540-00881-1 .
  19. Baburin, Danil E. (2002), "Some modifications of Sugiyama approach", Graph Drawing, 10th International Symposium, GD 2002, Irvine, CA, USA, August 26–28, 2002, Revised Papers, Lecture Notes in Computer Science, 2528, Springer, pp. 366–7, doi:10.1007/3-540-36151-0_36, ISBN 978-3-540-00158-4 .
  20. Bachmaier, Christian (2007), "A radial adaptation of the Sugiyama framework for visualizing hierarchical information", IEEE Transactions on Visualization and Computer Graphics 13 (3): 583–594, doi:10.1109/TVCG.2007.1000, PMID 17356223 .
  21. Hong, Seok-Hee; Nikolov, Nikola S. (2005), "Layered drawings of directed graphs in three dimensions", Proceedings of the 2005 Asia-Pacific Symposium on Information Visualisation (APVis '05), Conferences in Research and Practice in Information Technology, 45, pp. 69–74, ISBN 9781920682279, http://dl.acm.org/citation.cfm?id=1082326 .
  22. Pupyrev, Sergey; Nachmanson, Lev; Kaufmann, Michael (2011), "Improving layered graph layouts with edge bundling", Graph Drawing, 18th International Symposium, GD 2010, Konstanz, Germany, September 21-24, 2010, Revised Selected Papers, Lecture Notes in Computer Science, 6502, Springer, pp. 329–340, doi:10.1007/978-3-642-18469-7_30, ISBN 978-3-642-18468-0 .
  23. Eppstein, David; Goodrich, Michael T.; Meng, Jeremy Yu (2007), "Confluent layered drawings", Algorithmica 47 (4): 439–452, doi:10.1007/s00453-006-0159-8 .
  24. "On the parameterized complexity of layered graph drawing", Algorithmica 52 (2): 267–292, 2008, doi:10.1007/s00453-007-9151-1 .
  25. Cole, Richard (2001). "Automated layout of concept lattices using layered diagrams and additive diagrams". 23. pp. 47–53. doi:10.1109/ACSC.2001.906622. ISBN 0-7695-0963-0. 
  26. Benno Schwikowski; Peter Uetz; Stanley Fields (2000). "A network of protein−protein interactions in yeast". Nature Biotechnology 18 (12): 1257–61. doi:10.1038/82360. PMID 11101803.