betaFeedback

WorksComputer Science

Two-colour crossing minimization in complete geometric graphs is NP-hard

Abstract

Given a fixed straight-line drawing of a complete graph, we seek a two-colouring of its edges that minimizes monochromatic crossing pairs. We prove that the threshold decision problem is NP-complete, even for points in general position with integer coordinates. Thus exact minimization is NP-hard, resolving the complexity question posed at the Crossing Number Workshop in 2019. We reduce from MaxCut on permutation graphs by representing source vertices with classes of geometric edges, whose crossings encode source adjacencies. The target complete graph also contains every other edge between its points, and their freely chosen colours can affect the encoded cost. To control these interactions, we construct a large comparison grid with two stable colour phases and use program points to turn this reference into colour preferences on other edges. The optimum differs from a computable baseline plus the amplified minimum number of uncut source edges by an error small enough to distinguish consecutive source values. The reduction is deterministic, with polynomially many points and polynomial coordinate bit length.

Introduction

We study the complexity of minimizing monochromatic crossings over all edge two-colourings of a fixed complete geometric graph. This models placing the two colour classes on separate layers with the same vertex positions.

The complexity of finding an optimal two-colouring of a fixed straight-line drawing of KNK_N was posed as Question 4 at the Crossing Number Workshop in 2019 [15 Section 1.4] and as the first open problem in Section 5 of Aichholzer et al. [2]. It was subsequently listed in Dagstuhl Seminar 21293 [10 Section 4.12] and at Geometric Graphs Week 2022 [16 Problem 11]. We prove that the threshold decision version is NP-complete, and hence that exact minimization is NP-hard. All edges may receive either colour; the input has no edge weights or prescribed colours.

Theorem 1.1. The decision problem in Definition 1.2 is NP-complete under deterministic polynomial-time many-one reductions. Consequently, computing OPT⁡(P)\operatorname{OPT}(\mathcal{P}) exactly is NP-hard. The decision problem remains NP-complete when all coordinates are integers encoded in binary.

Aichholzer, Mulzer, Schnider and Vogtenhuber [3] proved NP-completeness of MaxCut on segment intersection graphs. Completing a segment family introduces new colour variables and costs that can depend on the original colours (Proposition 1.4). Their result therefore does not settle the complete-graph problem.

The contrast is already visible in convex position. Two-colour crossing minimization for an arbitrary graph drawn on a convex point set is NP-hard, by the fixed-order two-page result of Masuda et al. [13]. For a complete graph, however, the optimum is the known two-page crossing number of KNK_N [1]. Our reduction uses this exact value for two convex background components.

We reduce from MaxCut on permutation graphs, whose NP-completeness proof supplies a permutation representation [8]. Classes of chords encode source vertices and amplify the number of uncut source edges. Program points induce costs on these chords using a comparison grid as a colour reference, while the remaining edges contribute a computable baseline and an error smaller than one amplified source unit.

Aichholzer et al. [2] give two-colourings of a double-chain bipartite drawing with asymptotic crossing ratio at most 1/31/3 (Appendix B, Theorem 6). We prove the corresponding continuous minimum and two-phase stability, then obtain localization for finite rectangles under arbitrary bounded unary perturbations. The stability exponent is not optimized.

Other results concern extremal or approximate versions of the objective. Bounds over all drawings and duplication constructions were developed in [2]; extensions to dense graphs, random points and several colours appear in [9, 6, 11]. For a fixed complete geometric graph, the crossing graph is dense, and the MaxCut scheme of Arora, Karger and Karpinski [4] gives additive approximation on the scale of N4N^4, as observed in [11]. These results do not determine the exact optimum.

Lean proof code and reproducible exact computations are available in the accompanying repository [17].

§ 2 outlines the construction. We then prove the grid estimates in § 3, realize the crossing relations in § 4, and analyze the core in § 5. § 6 completes the proof of Theorem 1.1.

Preliminaries

Definition 1.2. The input to complete geometric two-colour crossing minimization is a list of pairwise distinct points P∈(Q2)NP \in(\mathbb{Q}^{2})^{N} with no three collinear, together with an integer ktgtk_{\mathrm{tgt}} in the decision version. Coordinates and ktgtk_{\mathrm{tgt}} are encoded in binary. Write

E(P)={ij:0≤i<j<N},M(P,χ)=∑{e,f}⊆E(P)1[e and f cross properly] 1[χ(e)=χ(f)]E(\mathcal{P}) = \{ij : 0 \le i < j < N\}, \qquad M(\mathcal{P},\chi) = \sum_{\{e,f\}\subseteq E(\mathcal{P})} \mathbf{1}[e\text{ and }f\text{ cross properly}]\,\mathbf{1}[\chi(e)=\chi(f)]

for χ:E(P)→{0,1}\chi: E(\mathcal{P}) \to\{0,1\}, and put OPT⁡(P)=min⁡χM(P,χ)\operatorname{OPT}(\mathcal{P}) = \min_{\chi} M(\mathcal{P},\chi). The decision question is whether OPT⁡(P)≤ktgt\operatorname{OPT}(\mathcal{P}) \le k_{\mathrm{tgt}}.

A proper crossing is an intersection of two open segments with four distinct endpoints. We write e∼fe \sim f when edges ee and ff cross properly. Several crossing pairs may have the same geometric intersection point; each pair is counted separately. The colouring is unrestricted: it is not a proper edge colouring in the graph-theoretic sense.

The crossing graph Γ(P)\Gamma(\mathcal{P}) has one vertex for each geometric edge and an adjacency for each proper crossing. Writing cr⁡(P)=∣E(Γ(P))∣\operatorname{cr}(\mathcal{P}) = |E(\Gamma(\mathcal{P}))|, we have

OPT⁡(P)=cr⁡(P)−MaxCut⁡(Γ(P)).(1)\operatorname{OPT}(\mathcal{P}) = \operatorname{cr}(\mathcal{P}) - \operatorname{MaxCut}(\Gamma(\mathcal{P})). \tag*{(1)}

Indeed, every crossing is either monochromatic or belongs to the cut induced by the two edge colours. Throughout, graph edges and crossing pairs are unordered unless an order is explicitly specified.

A represented permutation graph GG on [n]={1,…,n}[n] = \{1,\ldots,n\} is specified, after relabelling one order, by a permutation π\pi, with ij∈E(G)ij \in E(G) if and only if i<ji < j and π(i)>π(j)\pi(i) > \pi(j). A permutation representation can also be found from the abstract graph in deterministic O(∣V(G)∣+∣E(G)∣)O(|V(G)|+|E(G)|) time [14 pp. 212–213]. Put

g(G)=min⁡x:V(G)→{0,1}∑uv∈E(G)1[x(u)=x(v)]=∣E(G)∣−MaxCut⁡(G).g(G) = \min_{x:V(G)\to\{0,1\}} \sum_{uv\in E(G)} \mathbf{1}[x(u)=x(v)] = |E(G)|-\operatorname{MaxCut}(G).

A source threshold ksrck_{\mathrm{src}} is thus equivalent to g(G)≤tg(G) \le t, where t=∣E(G)∣−ksrct = |E(G)| - k_{\mathrm{src}}. We use NN for the number of target points and NgN_g for the number of comparison-grid vertices, each of which is a target edge.

For nonnegative integers vv, define

Z(v)=14⌊v2⌋⌊v−12⌋⌊v−22⌋⌊v−32⌋(v≥3),Z(0)=Z(1)=Z(2)=0.Z(v) = \frac{1}{4}\left\lfloor\frac{v}{2}\right\rfloor\left\lfloor\frac{v-1}{2}\right\rfloor\left\lfloor\frac{v-2}{2}\right\rfloor\left\lfloor\frac{v-3}{2}\right\rfloor\qquad(v \ge3), \qquad Z(0)=Z(1)=Z(2)=0.

The theorem of Ábrego et al. [1 Theorem 7] says that Z(v)Z(v) is the optimum for a convex complete geometric graph: a same-page pair of edges in a two-page drawing crosses exactly when its endpoints alternate in the linear order. Boundary edges do not affect this count.

Proposition 1.3. The problem in Definition 1.2 belongs to NPNP. Rational and integer coordinate versions are polynomial-time equivalent.

Proof. Let LL be the input bit length. Normalize the coordinate denominators to be positive and let DD be their product. Multiplying all coordinates by DD gives integers of O(L)O(L) bits, preserves orientation signs, and takes polynomial time.

Pairwise distinctness and absence of collinear triples can be checked by examining point pairs and the determinants

or⁡(a,b,c)=(bx−ax)(cy−ay)−(by−ay)(cx−ax).\operatorname{or}(a,b,c)=(b_x-a_x)(c_y-a_y)-(b_y-a_y)(c_x-a_x).

These tests determine whether the point set satisfies the conditions in Definition 1.2. A certificate consists of the (N2)\binom{N}{2} edge colours. For every unordered pair abab, cdcd with four distinct endpoints, a proper crossing is equivalent to

or⁡(a,b,c)or⁡(a,b,d)<0,or⁡(c,d,a)or⁡(c,d,b)<0.\operatorname{or}(a,b,c)\operatorname{or}(a,b,d)<0,\qquad\operatorname{or}(c,d,a)\operatorname{or}(c,d,b)<0.

The verifier accepts precisely when the point set satisfies these conditions and the monochromatic crossing count is at most ktgtk_{\mathrm{tgt}}. The O(N4)O(N^4) tests use integers of polynomial bit length, so verification takes polynomial time. Scaling reduces rational inputs to integer inputs; the converse inclusion is immediate.

A direct-completion obstruction

Proposition 1.4. Completing a segment family to the complete geometric graph on its endpoints can produce an optimum whose restriction to the original family is not optimal. The minimum contribution of the added edges can also depend on the prescribed source colours.

Proof. Let pi=(i,i2)p_i=(i,i^2), 0≤i<60\le i<6, and abbreviate pipjp_ip_j by ijij. The source family {01,24,35}\{01,24,35\} has only one crossing, between 2424 and 3535, and therefore has optimum zero.

The complete drawing is convex, so its optimum is Z(6)=3Z(6)=3 by Ábrego et al. [1, Theorem 7]. Colour 03, 04, 13, 14 blue and every other edge red. The monochromatic pairs are exactly (02, 15), (03, 14), (24, 35), attaining this lower bound. Its source restriction has cost one and is not optimal. Conditional on 24, 35 having the same colour, the minimum added cost is thus two.

Instead colour 14, 15, 24, 25 blue and every other edge red. The monochromatic pairs are (02, 13), (04, 35), (14, 25), again attaining three. Now 24, 35 differ, the source cost is zero, and the minimum added cost is three. Hence the optimum added cost depends on the source colours. □

Overview of the construction

We encode a source cut by colours of selected edges, then control the other edges required by completeness. Line styles in the diagrams distinguish edge roles.

From a source cut to selected chords

Placing the endpoint orders of a permutation representation in early and late blocks on a convex chain, with the second order reversed, gives chords that cross exactly for adjacent source vertices. Their monochromatic crossings count the uncut source edges.

To amplify this cost, replace each chord by qq nested macro chords. Each macro endpoint becomes a cluster of WW points; all W2W^2 edges between paired clusters form one bundle. One source vertex is thus represented by qq bundles, or qW2qW^2 selected edges (Figure 1). Adjacent source vertices give (qW2)2=Δ(qW^2)^2=\Delta crossing pairs between their classes. If each class is monochromatic, the cost is Δ\Delta when their colours agree and zero otherwise.

Figure 1. Source expansion at illustrative sizes. Each shaded strip in (a) is a WW-point cluster. Both bundles contain all W2W^2 edges; these are separate local views, not their global positions. In (b), the connector denotes pairwise crossing, not a target edge; nonadjacent classes have no crossings.

Identical inter-class neighbours give a class-monochromatic optimum of value Δg(G)\Delta g(G) for this term (Lemma 5.1). Within-bundle crossings and certain short-edge interactions, set aside in the analysis, cost at most 2SW42SW^4 to restore (Lemma 5.6).

Controlling the completion edges

The original chain PP contains the endpoint clusters and a middle block of dummy points. The PPPP edges form the core CC. Its selected edges encode the cut, but the other core edges can alter its cost. We add a chain of frame points AA and program points RR to control them. The target is complete on P∪A∪RP\cup A\cup R; notation such as APAP names an edge family (Figure 2).

Figure 2. Layout and edge classes (not to scale). The shaded convex region contains PP, RR; APAP interiors lie outside. The same fan crosses the canonical grid at 1; freezing its response gives a core unary cost at 2. Open circles mark crossings; the diagram shows representative edges.

The APAP edges, denoted by XX, form a rectangular comparison grid with two complementary reference colourings, called phases; position (i,j)(i,j) represents the edge AiPjA_iP_j. In a free optimum the grid stays close to one phase, even with all external costs. Complementing all colours exchanges the phases and preserves the cost.

Geometric separation prevents APAP–PPPP crossings. The RARA edges, called program fans and denoted by TfT_f, connect the systems by crossing grid and core edges. Once a fan’s colour is fixed, each core edge it crosses pays one in that colour and zero in the other. This induces a unary cost depending on that edge’s colour.

We analyze the core with the fans fixed to their canonical responses to the grid. Ordinary programs then force a known colouring on the palette edges CpalC_{\mathrm{pal}}. Rank programs compensate for the palette’s varying bias across each selected bundle; the ordinary programs are calibrated so that only a small residual bias remains there. Short edges and dummy–dummy edges remain free, with their minima accounted for separately. The final argument bounds the cost of fixing the fans while keeping the actual grid colouring unchanged.

All remaining edge families also enter the cost. The AAAA edges, denoted by II, form an isolated convex component. Separation excludes crossings of APAP with RPRP or RRRR, and a uniform bound controls all other interactions of Y=RP∪RRY = RP \cup RR. The resulting estimate is

Kbase+Δg(G)−E−≤OPT⁡(P)≤Kbase+Δg(G)+E+,4(E−+E+)<Δ.(2)K_{\mathrm{base}} + \Delta_g(G) - E_- \le\operatorname{OPT}(\mathcal{P}) \le K_{\mathrm{base}} + \Delta_g(G) + E_+,\qquad4(E_- + E_+) < \Delta. \tag*{(2)}

The baseline uses reference colours, unary corrections and known convex optima. Proposition 6.1 proves the bounds by freezing fans and restoring RP∪RRRP \cup RR. Integrality of g(G)g(G) then transfers the source threshold to one complete drawing.

Parameters and their roles

For n≥1n \ge1 fix the following integers:

q=16(n+1),S=nq,d=S+1,H=24200d14,W=H4,B=H5,Dm=512SW,o=2SW+Dm=514SW,T=213o2,Λpal=213dT,Δ=q2W4.(3)\begin{aligned} q &= 16(n+1),\qquad S = nq,\qquad d = S+1,\qquad H = 2^{4200}d^{14},\\ W &= H^4,\qquad B = H^5,\qquad D_m = 512SW,\qquad o = 2SW + D_m = 514SW,\\ T &= 2^{13}o^2,\qquad\Lambda_{\mathrm{pal}} = 2^{13}dT,\qquad\Delta= q^2W^4. \tag*{(3)} \end{aligned}

There are SS selected macro chords, oo original points and BB frames. If ss is the number of program points, the complete drawing has N=B+o+sN = B + o + s points, whereas the comparison grid has Ng=BoN_g = Bo vertices. The symbol nn in the abstract grid Jm,nJ_{m,n} is a local dimension; in the construction those dimensions are B,oB,o.

The cluster size WW amplifies the source signal, while qq controls the relative local restoration cost. The scale HH makes the grid perturbations, freezing cost and nonfan interactions small relative to that signal. The frame count BB controls the grid strength and program weights, and the dummy block makes both selected rank slopes negative. The spacing TT separates palette preferences, and Λpal\Lambda_{\mathrm{pal}} dominates adverse core interactions. § 6 verifies these scale requirements. The constants are not optimized, and the resulting instance sizes remain impractical.

Stability of the comparison grid

In the comparison grid (Figure 3), two positions are adjacent when both coordinate orders strictly agree (Lemma 4.1). Fixing outside colours induces unary costs Uij(c)U_{ij}(c): a fixed fan rAkrA_k contributes 1[c=trk]\mathbf{1}[c=t_{r k}] at each grid edge that it crosses.

Figure 3. The comparison grid represents APAP edges, not geometric points. In the first two panels dark cells have colour 1 and light cells colour 0; the negative phase is the exact complement, including diagonal ties. In the third panel shading denotes neighbours of a rank fan, independently of colour: i<ki<k, j<r0j<r_0 or i>ki>k, j≥r0j\ge r_0. The last panel shows the diagonal strip and two corner regions containing all errors FF of a minimizing colouring relative to a phase. The displayed mesh and width are illustrative, not the quantitative theorem’s scales.

For a grid colouring cc, the cellwise sign function is fc=2c−1f_c=2c-1. The normalized grid cost ΦJ(c)/Ng2\Phi_J(c)/N_g^2 approximates E(fc)\mathcal{E}(f_c) below, with a mesh error. Near-minimal energy gives nearly threshold rows and columns, then a profile close to one of two phases. Single-vertex optimality in a finite grid confines disagreements to a diagonal strip and two corners. Theorem 3.4 also gives a lower bound for any colouring with that localized support. We use this bound after changing the program colours while keeping the grid fixed.

The continuous comparison energy

All integrals in this section use Lebesgue measure. Functions are Borel measurable; the statements also hold for Lebesgue-measurable functions after replacement on a null set. For a sign function f:[0,1]2→{−1,1}f : [0,1]^2 \to\{-1,1\}, put

\mathcal{E}(f)=\iiiint_{\substack{0\le u<u'\le1\\0\le v<v'\le1}}\mathbf{1}\{f(u,v)=f(u',v')\}\,du\,dv\,du'\,dv'. \tag*{(4)}

Each comparable unordered pair occurs once. Define

References

  1. [1]Bernardo M. Ábrego, Oswin Aichholzer, Silvia Fernández-Merchant, Pedro Ramos, and Gelasio Salazar. The 2-page crossing number of Kₙ. Discrete & Computational Geometry, 49(4):747–777, 2013. doi:10.1007/s00454-013-9514-0.DOI
  2. [2]Oswin Aichholzer, Ruy Fabila-Monroy, Adrian Fuchs, Carlos Hidalgo-Toscano, Irene Parada, Birgit Vogtenhuber, and Francisco Zaragoza. On the 2-colored crossing number. Preprint, arXiv:1908.06461v2, 2019.arxiv.org/abs/1908.06461
  3. [3]Oswin Aichholzer, Wolfgang Mulzer, Patrick Schnider, and Birgit Vogtenhuber. NP-completeness of Max-Cut for segment intersection graphs. In Proceedings of the 34th European Workshop on Computational Geometry (EuroCG 2018), pages 32:1–32:6, 2018. Extended abstract. https://page.mi.fu-berlin.de/mulzer/pubs/maxcutEWCG.pdf.
  4. [4]Sanjeev Arora, David Karger, and Marek Karpinski. Polynomial time approximation schemes for dense instances of NP-hard problems. Journal of Computer and System Sciences, 58(1):193–210, 1999. doi:10.1006/jcss.1998.1605.DOI
  5. [5]Christian Borgs, Jennifer Chayes, László Lovász, Vera T. Sós, Balázs Szegedy, and Katalin Vesztergombi. Graph limits and parameter testing. In Proceedings of the 38th Annual ACM Symposium on Theory of Computing, pages 261–270, 2006. doi:10.1145/1132516.1132556.DOI
  6. [6]Sergio Cabello, Éva Czabarka, Ruy Fabila-Monroy, Yuya Higashikawa, Raimund Seidel, László Székely, Josef Tkadlec, and Alexandra Wesolek. A note on the 2-colored rectilinear crossing number of random point sets in the unit square. Acta Mathematica Hungarica, 173(1):214–226, 2024. doi:10.1007/s10474-024-01436-9.DOI
  7. [7]Gisella Croce and Bernard Dacorogna. On a generalized Wirtinger inequality. Discrete and Continuous Dynamical Systems, 9(5):1329–1341, 2003. doi:10.3934/dcds.2003.9.1329.DOI
  8. [8]Celina M. H. de Figueiredo, Aleksander A. de Melo, Fabiano S. Oliveira, and Ana Silva. MaxCut on permutation graphs is NP-complete. Journal of Graph Theory, 104(1):5–16, 2023. doi:10.1002/jgt.22948.DOI
  9. [9]Ruy Fabila-Monroy. A note on the k-colored crossing ratio of dense geometric graphs. Computational Geometry, 124–125:102123, 2025. doi:10.1016/j.comgeo.2024.102123.
  10. [10]Robert Ganian, Fabrizio Montecchiani, Martin Nöllenburg, and Meirav Zehavi. Parameterized complexity in graph drawing (Dagstuhl seminar 21293). Dagstuhl Reports, 11(6):82–123, 2021. Editors; see Vogtenhuber’s Problem 2 in Section 4.12, p. 107. doi:10.4230/DagRep.11.6.82.DOI
  11. [11]Benedikt Hahn, Bettina Klinz, and Birgit Vogtenhuber. On the geometric k-colored crossing number. In Proceedings of the 13th European Conference on Combinatorics, Graph Theory and Applications (EuroComb 2025): Booklet of Extended Abstracts, pages 603–611, 2025. Extended abstract. https://site.pheedloop.com/event/Eurocomb25/Abstracts.arxiv.org/abs/2505.18014
  12. [12]Ferran Hurtado, Marc Noy, and Jorge Urrutia. Flipping edges in triangulations. Discrete & Computational Geometry, 22(3):333–346, 1999. doi:10.1007/PL00009464.DOI
  13. [13]Sumio Masuda, Kazuo Nakajima, Toshinobu Kashiwabara, and Toshio Fujisawa. Crossing minimization in linear embeddings of graphs. IEEE Transactions on Computers, 39(1):124–127, 1990. doi:10.1109/12.46286.
  14. [14]Ross M. McConnell and Jeremy P. Spinrad. Modular decomposition and transitive orientation. Discrete Mathematics, 201(1–3):189–241, 1999. doi:10.1016/S0012-365X(98)00319-7.DOI
  15. [15]Birgit Vogtenhuber. Bicolouring crossings in a straight-line drawing of Kₙ. Crossing Numbers Workshop 2019, open-problem summary, 2019. Section 1.4, Question 4, p. 3. https://www.fi.muni.cz/~hlinený/papers/Summary_CRNW2019.pdf.
  16. [16]Birgit Vogtenhuber. 2-colored crossing number. GGWeek 2022 problem booklet, 17th European Research Week on Geometric Graphs, 2022. Problem 11, pp. 28–29. https://tutte.fernuni-hagen.de/web/ggweek/GGWeek2022.pdf.arxiv.org/abs/1908.06461
  17. [17]Zhe Zhang. Two-colour crossing minimization in complete geometric graphs: proof code and reproducible computations. https://github.com/Myyura/two-colour-crossing-complete-geometric-graphs, 2026. Software and verification documentation.

Paper details

vlnc:W_p78znyer
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 9

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents