Nearest-Neighbor Decompositions of Drawings

Authors Jonas Cleve , Nicolas Grelier, Kristin Knorr , Maarten Löffler, Wolfgang Mulzer , Daniel Perz

Thumbnail PDF


  • Filesize: 1.25 MB
  • 16 pages

Document Identifiers

Author Details

Jonas Cleve
  • Institut für Informatik, Freie Universität Berlin, Germany
Nicolas Grelier
  • Department of Computer Science, ETH Zürich, Switzerland
Kristin Knorr
  • Institut für Informatik, Freie Universität Berlin, Germany
Maarten Löffler
  • Utrecht University, The Netherlands
Wolfgang Mulzer
  • Institut für Informatik, Freie Universität Berlin, Germany
Daniel Perz
  • Technische Universität Graz, Austria

Cite AsGet BibTex

Jonas Cleve, Nicolas Grelier, Kristin Knorr, Maarten Löffler, Wolfgang Mulzer, and Daniel Perz. Nearest-Neighbor Decompositions of Drawings. In 18th Scandinavian Symposium and Workshops on Algorithm Theory (SWAT 2022). Leibniz International Proceedings in Informatics (LIPIcs), Volume 227, pp. 21:1-21:16, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2022)


Let 𝒟 be a set of straight-line segments in the plane, potentially crossing, and let c be a positive integer. We denote by P the union of the endpoints of the straight-line segments of 𝒟 and of the intersection points between pairs of segments. We say that 𝒟 has a nearest-neighbor decomposition into c parts if we can partition P into c point sets P₁, … , P_c such that 𝒟 is the union of the nearest neighbor graphs on P₁, … , P_c. We show that it is NP-complete to decide whether 𝒟 can be drawn as the union of c ≥ 3 nearest-neighbor graphs, even when no two segments cross. We show that for c = 2, it is NP-complete in the general setting and polynomial-time solvable when no two segments cross. We show the existence of an O(log n)-approximation algorithm running in subexponential time for partitioning 𝒟 into a minimum number of nearest-neighbor graphs. As a main tool in our analysis, we establish the notion of the conflict graph for a drawing 𝒟. The vertices of the conflict graph are the connected components of 𝒟, with the assumption that each connected component is the nearest neighbor graph of its vertices, and there is an edge between two components U and V if and only if the nearest neighbor graph of U ∪ V contains an edge between a vertex in U and a vertex in V. We show that string graphs are conflict graphs of certain planar drawings. For planar graphs and complete k-partite graphs, we give additional, more efficient constructions. We furthermore show that there are subdivisions of non-planar graphs that are not conflict graphs. Lastly, we show a separator lemma for conflict graphs.

Subject Classification

ACM Subject Classification
  • Theory of computation → Computational geometry
  • nearest-neighbors
  • decompositions
  • drawing


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. D. Eppstein, M.S. Paterson, and F.F. Yao. On nearest-neighbor graphs. Discrete Comput Geom, 17:263-282, 1997. URL:
  2. István Fáry. On straight-line representation of planar graphs. Acta scientiarum mathematicarum, 11(229-233):2, 1948. Google Scholar
  3. Jacob Fox and János Pach. A separator theorem for string graphs and its applications. Combinatorics, Probability and Computing, 19(3):371-390, 2010. Google Scholar
  4. Jacob Fox and János Pach. Computing the independence number of intersection graphs. In Proceedings of the twenty-second annual ACM-SIAM symposium on Discrete algorithms, pages 1161-1165. SIAM, 2011. Google Scholar
  5. Michael R. Garey, David S. Johnson, and Larry J. Stockmeyer. Some simplified NP-complete graph problems. Theoretical Computer Science, 1:237-267, 1976. URL:
  6. Albert Gräf, Martin Stumpf, and Gerhard Weißenfels. On coloring unit disk graphs. Algorithmica, 20(3):277-293, 1998. Google Scholar
  7. J.W. Jaromczyk and G.T. Toussaint. Relative neighborhood graphs and their relatives. Proc. of the IEEE, 80(9):1502-1517, 1992. Google Scholar
  8. Petr Kolman and Jiřı Matoušek. Crossing number, pair-crossing number, and expansion. Journal of Combinatorial Theory, Series B, 92(1):99-113, 2004. Google Scholar
  9. Maarten Löffler, Mira Kaiser, Tim van Kapel, Gerwin Klappe, Marc van Kreveld, and Frank Staals. The connect-the-dots family of puzzles: Design and automatic generation. ACM Transactions on Graphics, 33(4):72, 2014. URL:
  10. Joseph S. B. Mitchell and Wolfgang Mulzer. Proximity algorithms. In Jacob E. Goodman, Joseph O'Rourke, and Csaba D. Tóth, editors, Handbook of Discrete and Computational Geometry, chapter 32, pages 849-874. CRC Press, Boca Raton, 3rd edition, 2017. URL:
  11. F. W. Sinden. Topology of thin film RC circuits. The Bell System Technical Journal, 45(9):1639-1662, 1966. URL:
  12. Tim van Kapel. Connect the closest dot puzzles. Master’s thesis, Utrecht University, 2014. URL: