Simple and Efficient Bilayer Cross Counting

  • Wilhelm Barth
  • Michael Jünger
  • Petra Mutzel
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2528)


We consider the problem of counting the interior edge crossings when a bipartite graph G = (V,E) with node set V and edge set E is drawn such that the nodes of the two shores of the bipartition are drawn as distinct points on two parallel lines and the edges as straight line segments. The efficient solution of this problem is important in layered graph drawing. Our main observation is that it can be reduced to counting the inversions of a certain sequence. This leads to an O(∣E∣+∣C∣) algorithm, where C denotes the set of pairwise interior edge crossings, as well as to a simple O(∣E∣ log ∣Vsmall∣) algorithm, where Vsmall is the smaller cardinality node set in the bipartition of the node set V of the graph. We present the algorithms and the results of computational experiments with these and other algorithms on a large collection of instances.


  1. 1.
    B. Chazelle, Reporting and counting segment intersections. Journal of Computer and System Sciences 32 (1986) 156–182.Google Scholar
  2. 2.
    B. Chazelle and H. Edelsbrunner, An optimal algorithm for intersecting line segments in the plane. Journal of the ACM 39 (1992) 1–54.MATHCrossRefMathSciNetGoogle Scholar
  3. 3.
    T. H. Cormen, C. E. Leiserson, and R. L. Rivest, Introduction to algorithms. MIT Press, Cambridge, MA, 1990.Google Scholar
  4. 4.
    P. Eades and N. Wormald, Edge crossings in drawings of bipartite graphs. Algorithmica 11 (1994) 379–403.MATHCrossRefMathSciNetGoogle Scholar
  5. 5.
    C. Gutwenger, M. Jünger, G. W. Klau, S. Leipert, and P. Mutzel, Graph Drawing Algorithm Engineering with AGD. in: S. Diehl (ed.), Software Visualization, International Dagstuhl Seminar on Software Visualization 2001, Lecture Notes in Computer Science 2269, Springer, 2002, pp. 307–323, see also: Google Scholar
  6. 6.
    M. Jünger and P. Mutzel, 2-layer straight line crossing minimization: performance of exact and heuristic algorithms. Journal of Graph Algorithms and Applications 1 (1997) 1–25.MathSciNetGoogle Scholar
  7. 7.
    D. E. Knuth, The Stanford GraphBase: A platform for combinatorial computing. Addison-Wesley, Reading, Massachusetts, 1993Google Scholar
  8. 8.
    G. S. Lueker, A data structure for orthogonal range queries. Proceedings of the 19th IEEE Symposium on Foundations of Computer Science, 1978, pp. 28–34.Google Scholar
  9. 9.
    G. Sander, Graph Layout through the VCG Tool. in: R. Tamassia and I. G. Tollis (eds): Graph Drawing 1994, Lecture Notes in Computer Science 894, Springer, 1995, pp. 194–205, see also: Google Scholar
  10. 10.
    G. Sander, Visualisierungstechniken für den Compilerbau. Pirrot Verlag & Druck, Saarbrücken, 1996.Google Scholar
  11. 11.
    K. Sugiyama, S. Tagawa, and M. Toda, Methods for visual understanding of hierarchical system structures. IEEE Transactions on Systems, Man, and Cybernetics 11 (1981) 109–125.MathSciNetCrossRefGoogle Scholar
  12. 12.
    V. Waddle and A. Malhotra, An E log E line crossing algorithm for levelled graphs. in: J. Kratochvíl (ed.) Graph Drawing 1999, Lecture Notes in Computer Science 1731, Springer, 1999, pp. 59–70.CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2002

Authors and Affiliations

  • Wilhelm Barth
    • 1
  • Michael Jünger
    • 2
  • Petra Mutzel
    • 1
  1. 1.Institut für Computergraphik und AlgorithmenTechnische Universität WienWienAustria
  2. 2.Institut für InformatikUniversität zu KölnKölnGermany

Personalised recommendations