arXiv:2610.32954cs.DSOct 2026

Manuscript Offprint

arXiv:2610.32954

Acyclic 2-edge-coloured graphs: polynomial-time linkages and colouring hardness

Jørgen Bang-Jensen, Stéphane Bessy, Amadeus Reinald

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

A path or cycle in a 2-edge-coloured graph is alternating if consecutive edges have different colours. These objects are natural analogues of paths and cycles in graphs, and even more so in digraphs. A well-studied class is that of acyclic 2-edge-coloured graphs, that is, those forbidding alternating cycles. In particular, (acyclic) 2-edge-coloured graphs generalize directed (acyclic) graphs (DAGs), but the complexity of problems on DAGs is much better understood than that of the corresponding problems on acyclic 2-edge-coloured graphs. We investigate the complexity of two such problems, whose directed counterparts are well-known.

Our first result is an nO(k)n^{O(k)}-time algorithm for the alternating k-linkage problem on acyclic 2-edge-coloured graphs. This problem asks for k vertex-disjoint alternating paths joining k prescribed pairs of vertices. This generalizes the directed k-linkage algorithm for DAGs. For every fixed k, this also yields a polynomial-time algorithm for finding k internally vertex-disjoint alternating (s,t)(s,t)-paths, solving an open problem by Abouelaoualim et al. from 2008.

We then consider the alternating chromatic number of 2-edge-coloured graphs, defined as the minimum number of parts in a vertex partition such that each part induces an acyclic subgraph. This notion is analogous to the dichromatic number of digraphs, where it is known that deciding dichromatic number 2 is NP-complete even on tournaments. Our second result is that deciding alternating chromatic number 2 is NP-complete on complete 2-edge-coloured graphs. Equivalently, deciding whether a graph can be partitioned into two induced threshold graphs is NP-complete.

Keywords: 2-edge-coloured graph; alternating cycle; linkages; alternating chromatic number; acyclic ordering; polynomial algorithm; NP-complete

*School of Mathematics, Shandong University, Jinan 250100, China. Department of Mathematics and Computer Science, University of Southern Denmark, Odense. jbj@imada.sdu.dk

†LIRMM, CNRS, Université de Montpellier, France. Supported by the French ANR project ANR-24-CE48-4377 (GODASse) Stephane.Bessy@lirmm.fr

†^{\dagger}University of Warsaw, Poland. Supported by Polish National Science Centre SONATA BIS-12 grant number 2022/46/E/ST6/00143. reinald@mimuw.edu.pl

1 Introduction

A 2-edge-coloured graph is an undirected graph G=(V,E)G = (V, E) with a colour assignment ϕ:E→{1,2}\phi: E \to \{1, 2\} to its edges. 2-edge-coloured graphs have been studied in a large number of papers (see e.g. [1, 4, 5, 8, 11, 16, 19] and [2, Chapter 16]). In an edge-coloured graph, a path is properly coloured if its consecutive edges have distinct colours. With two colours, this condition forces the colours to alternate, and we call such paths alternating paths. Imposing the same condition on cycles gives alternating cycles. Alternating paths and cycles are well-studied in the theory of edge-coloured graphs [4, 19].

The generality of 2-edge-coloured graphs is particularly well exemplified by a standard reduction from digraphs, see Definition 2.1. Indeed, any digraph can be reduced to an equivalent 2-edge-coloured graph, through the following standard transformation of Häggkvist: replace each arc xy by a two-edge path xvxyyxv_{xy}y whose edges have colours 1 and 2. Then, directed paths and cycles lift to alternating paths and cycles, see also [2, Section 16.1].

In this paper, we are particularly interested in acyclic 2-edge-coloured graphs, that is, those forbidding alternating cycles. These admit an elegant characterization through vertex orderings, by a theorem of Grossman–Häggkvist [17], later generalized by Yeo for more colours [20]. The structure of acyclic 2-edge-coloured graphs has been studied in several papers e.g. [1, 16]. In particular, acyclic digraphs (or DAGs) reduce (via Definition 2.1) to acyclic 2-edge-coloured graphs. Then, acyclic orderings of 2-edge-coloured graphs can be seen as a generalization of acyclic (or topological) orderings of DAGs.

While the reduction from digraphs carries the hardness of many directed path and cycle problems to their 2-edge-coloured analogues, it also begs for generalizations of polynomial algorithms for restricted classes of digraphs to corresponding restrictions of 2-edge-coloured graphs. Acyclicity in digraphs is now well-established as a restriction in which plenty of problems become tractable, often through structural means (see [3, Chapter 3]).

In this paper, our motivation is to expand our algorithmic understanding of acyclicity in 2-edge-coloured graphs, through two problems whose directed analogues have classical complexity results. The first problem concerns the 2-edge-coloured variant of the k-linkage problem, for which we provide a polynomial-time algorithm under acyclicity for every fixed k. The second is a 2-colouring analogous to dicolourings for digraphs, where we show NP-hardness even in complete 2-edge-coloured graphs. Equivalently, partitioning into two induced threshold graphs is NP-complete. We motivate these problems and introduce our results separately below.

Alternating linkages and paths In both the undirected and directed settings, the well-studied k-linkage problem asks, given vertices s1,…,sks_1, \ldots, s_k and t1,…,tkt_1, \ldots, t_k, for k disjoint (directed) paths linking sis_i to tit_i for each i. Fortune, Hopcroft and Wyllie [14] proved that the k-linkage problem is NP-complete for digraphs, already when k=2k = 2. On the positive side, the same paper shows that in DAGs, for every fixed k, the k-linkage problem can be solved in poly-nomial time. Their algorithm can be interpreted so that it makes explicit use of an acyclic ordering of the input digraph. In light of (acyclic) 2-edge-coloured graphs generalizing (acyclic) digraphs, a natural question is to extend the results above to alternating linkages, through the following problem.

ALTERNATING k-LINKAGE

Input: 2-edge-coloured graph G, 2k distinct terminals paired as (si,ti)i∈[k](s_i, t_i)_{i \in [k]}

Question: Are there k vertex-disjoint alternating paths joining (si,ti)i≤k(s_i, t_i)_{i \leq k} in G?

It is easy to see that this problem strictly generalizes the directed linkage problem, by a mild adaptation of the reduction of a digraph to a 2-edge-coloured graph 1^{1}. Therefore, ALTERNATING k-LINKAGE is NP-complete for every k≥2k \geq 2, as a consequence of [14], as already observed in [1].

Manoussakis [19] considered alternating linkages in which each path has length at least 2 in complete 2-edge-coloured graphs (direct edges would trivialize the problem). There, he gave an O(nk)O(n^k) algorithm for the vertex-disjoint alternating k-linkage problem, a polynomial algorithm for its edge-disjoint counterpart, and a polynomial algorithm computing the maximum number of internally disjoint alternating (s,t)(s,t)-paths. Other polynomial algorithms are known for disjoint alternating (s,t)(s,t)-paths under stronger acyclicity conditions [18].

Abouelaoualim, Das, Faria, Manoussakis, Martinhon, and Saad [1] considered multiple other problems about alternating trails and paths in 2-edge-coloured graphs, and asked whether acyclicity allows for efficient algorithms 2^{2}. While the longest alternating (s,t)(s,t)-path problem is NP-hard in general, their results imply a polynomial-time algorithm in acyclic graphs. In general 2-edge-coloured graphs, they showed that even for (fixed) k=2k = 2, deciding the existence of kk (internally) vertex-disjoint alternating (s,t)(s,t)-paths is NP-complete. Now, even when restricting to acyclic 2-edge-coloured graphs, if kk is part of the input, the problem is also NP-complete. This naturally led them to ask whether fixing kk would make the problem tractable.

Question 1.1 (Problem 4.1 [1]). For a fixed constant k≥2k \geq 2, is it NP-complete to decide whether an acyclic 2-edge-coloured graph contains k internally vertex-disjoint alternating (s,t)(s, t)-paths, for prescribed vertices s,ts, t?

In fact, they simultaneously posed the problem for the edge-disjoint variant.

Our first result is that linkages can be computed efficiently under acyclicity.

Theorem 1.2. For every fixed integer k≥2k \geq 2, ALTERNATING k-LINKAGE on acyclic 2-edge-coloured graphs can be solved in time nO(k)n^{O(k)}.

1^{1}Consider an instance D,(si)i≤k,(ti)i≤kD, (s_i)_{i \leq k}, (t_i)_{i \leq k} of the latter. Take the 2-edge-coloured graph derived from DD (Definition 2.1), and append pendant vertices si′s_i' (resp. ti′t_i') to each sis_i (resp. tit_i) terminal, adjacent with colour 2 (resp. 1).

2^{2}In fact, they consider the problem more generally for c-edge-coloured graphs with no properly coloured cycle.

The above strictly generalizes the polynomiality of the directed k-linkage problem in DAGs, thanks to Definition 2.1. Our algorithm consists in a dynamic computation over the acyclic orderings of [17]. Importantly, while directed paths are necessarily monotone in a topological ordering of a DAG, alternating paths may not be in an acyclic ordering. At a given step, our algorithm may inductively reduce the existence of a k-linkage to that of a (k+1)(k+1)-linkage, but acyclicity allows us to control the spread of this (larger) linkage across connected components, enabling us to reduce to previously computed k-linkage instances. Leveraging the same strategy, Theorem 1.2 can be adapted to work for edge-disjoint alternating k-linkages.

As a corollary, our algorithm for Theorem 1.2 allows us to answer Question 1.1 in the negative.

Corollary 1.3. For each fixed integer k≥2k \geq 2 there exists a polynomial algorithm deciding whether an acyclic 2-edge-coloured graph G has a set of k internally vertex-disjoint alternating (s,t)(s, t)-paths.

Adapting Theorem 1.2 to edge-disjoint linkages also yields the edge-disjoint variant of Corollary 1.3, completely settling Question 1.1.

Partitioning into acyclic subgraphs While there are links between (usual) colourings and digraphs, a more intrinsically directed analogue is the notion of dicolourings. The dichromatic number of a digraph D=(V,A)D = (V, A) is the minimum k such that there is a partition of V into sets V1,V2,…,VkV_1, V_2, \ldots, V_k (the dicolouring), each inducing an acyclic subdigraph. This parameter has been intensively studied structurally, and already the analogue of bipartiteness, that is, deciding dichromatic number 2, is NP-hard. A celebrated result due to Chen, Hu, and Zang shows that this problem remains hard within tournaments [10].

Theorem 1.4. [10] Deciding whether a tournament has dichromatic number 2 is NP-complete.

As with dicolourings, where “simple” subgraphs are acyclic ones, we can define an analogous colouring notion for 2-edge-coloured graphs as follows. An acyclic partition of a 2-edge-coloured graph G is a partition V1,...,VkV_1, ..., V_k of V(G)V(G) such that each ViV_i induces an acyclic 2-edge-coloured graph. Then, we define the alternating chromatic number of G as the minimum k such that G admits an acyclic partition into k sets. Deciding alternating chromatic number one amounts to deciding the nonexistence of an alternating cycle, which can be done in polynomial time thanks to the characterization of acyclicity of Grossman–Häggkvist [17]. Therefore, the first interesting question is whether deciding alternating chromatic number 2 is also polynomial-time solvable. Let us note that the standard reduction from digraphs doesn’t transfer this hardness. Indeed, because of subdivision vertices, the derived graph (Definition 2.1) always has alternating chromatic number at most 2.

Our second result shows the hardness of deciding alternating chromatic number 2, even when restricting to complete 2-edge-coloured graphs, yielding the analogue of Theorem 1.4.

Theorem 1.5. Deciding whether a 2-edge-coloured complete graph has alternating chromatic number 2 is NP-complete.

This result can also be seen through the lens of generalized graph colouring, where each part of a vertex partition must induce a graph from a prescribed class. Recall that a split graph admits a partition into a clique and an independent set, and that threshold graphs are precisely the P4P_{4}-free split graphs. Now, consider the bijection with usual graphs given by setting one colour to correspond to edges, and the other to non-edges. Then, as we show in Section 4, Theorem 1.5 implies that deciding whether a graph G can be partitioned into at most two induced threshold graphs is NP-complete.

In contrast, deciding whether a graph can be partitioned into two independent sets and one clique is polynomial-time solvable [9], as is partitioning into two “split” graphs, or equivalently, into two independent sets and two cliques [13]. Even partitioning into an independent set and a threshold graph is polynomial-time solvable [9]. Demange, Ekim and de Werra [12] previously studied the minimum number of threshold graphs needed to partition the vertex set, and proved this is NP-hard. While their hardness is for the problem of minimizing the number of parts, Theorem 1.5 establishes hardness already for two parts.

Structure of the paper We begin in Section 2 with preliminaries, including correspondences with digraphs, and the notion of acyclic orderings. Section 3 considers alternating paths in acyclic 2-edge-coloured graphs. We introduce the use of acyclic orderings with a polynomial algorithm for the longest alternating path problem, before showing Theorem 1.2. Finally, Section 4 deals with acyclic colourings, showing Theorem 1.5, then discussing an alternative colouring variant and related open problems.