List Coloring Ordered Graphs with Forbidden Induced Subgraphs
Abstract
In the List -Coloring problem we are given a graph whose every vertex is equipped with a list, which is a subset of . We need to decide if admits a proper coloring, where every vertex receives a color from its list.
The complexity of the problem in classes defined by forbidding induced subgraphs is a widely studied topic in algorithmic graph theory. Recently, Hajebi, Li, and Spirkl [SIAM J. Discr. Math. 38 (2024)] initiated the study of List -Coloring in ordered graphs, i.e., graphs with fixed linear ordering of vertices. Forbidding ordered induced subgraphs allows us to investigate the boundary of tractability more closely.
We continue this direction of research, focusing mostly on the case of List -Coloring. We present several algorithmic and hardness results, which altogether provide an almost complete dichotomy for classes defined by forbidding one fixed ordered graph: our investigations leave one minimal open case.
Keywords and phrases:
coloring, ordered graphs, forbidden induced subgraphsFunding:
Marta Piecyk: Supported by Polish National Science Centre, grant no. 2022/45/N/ST6/00237.Copyright and License:
2012 ACM Subject Classification:
Mathematics of computing Graph coloring ; Mathematics of computing Graph algorithmsFunding:
Editors:
Meena Mahajan, Florin Manea, Annabelle McIver, and Nguyễn Kim ThắngSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Coloring is one of the best studied problems in graph theory, both from structural and from algorithmic point of view. In this paper we are interested in the list variant of the problem. For a fixed integer , an instance of the List -Coloring problem is a pair , where is a graph and is a function mapping each vertex of to a subset of called list. We ask if admits a proper coloring where every vertex receives a color from its list . Clearly, this problem is NP-hard for all as it generalizes -Coloring. However, the presence of lists makes it hard even for very restricted instances, like bipartite graphs.
A popular approach for such problem is to explore the complexity on restricted instances, in order to understand the boundary of tractability. One of typical sources of such restricted instances comes from considering graphs excluding certain substructures, most notably, as induced subgraphs. For a graph , we say that a graph is -free if it does not contain as an induced subgraph.
The complexity of List -Coloring in -free graphs is quite well-understood. Let us introduce some notation. For an integer , by we denote the -vertex path. We use “” to denote disjoint union of graphs, so denotes the graph with two components, one isomorphic to and the other one to . We also write to denote the disjoint union of copies of .
Classic hardness reductions imply that if is not a linear forest (i.e., a forest of paths), then already List 3-Coloring is NP-hard for -free graphs [9, 15, 17]. On the other hand, for every , the List -Coloring problem in -free graphs is polynomial-time solvable if (a) is an induced subgraph of , for some [10, 3, 12], or (b) is an induced subgraph of , for some [14, 5].
For , all remaining cases are NP-hard [11, 16, 5]. The List 4-Coloring problem is NP-hard for -free graphs [11, 16], which leaves a number of open cases for disconnected .
The case of List 3-Coloring is much more elusive. It is known to be in P for -free [2] and in -free graphs [4]. The general belief in the community is that List 3-Coloring in -free graphs should be solvable in polynomial time for any linear forest . This belief is supported by the existence of a quasipolynomial-time algorithm for all that cases [18]. This is a strong indication that the problem is not NP-hard. However, we seem to be very far from improving the quasipolynomial algorithm to a polynomial one.
Motivated by the notorious open case of , Hajebi, Li, and Spirkl [13] considered a slightly different setting. An ordered graph is a graph with a fixed linear order of vertices. For ordered graphs and , we say that is an induced subgraph of if it can be obtained from by deleting vertices. Thus, the relative ordering of vertices of must coincide with the relative ordering of their images in . Now, the notion of -free (ordered) graphs is a natural one: we forbid as an induced (ordered) subgraph.
We remark that this setting allows us to understand the distinction between easy and hard cases even better. Indeed, excluding as an unordered induced subgraph is equivalent to excluding all possible orderings of . But what if we exclude just one, or few possible orderings?
As a motivating example, consider the case that . The class of unordered -free graphs is very simple: every connected component of such a graph is a clique. Consequently, List -Coloring is polynomial-time-solvable for every .
Now let us look at the ordered setting. Up to isomorphism, there are three possible orderings of , i.e., , , and . It turns out that forbidding at least one of , leads to a problem that is in P for every fixed . (As observed by Hajebi et al. [13], the instances of such a problem are chordal, see Proposition 1). However, List -Coloring is NP-hard in -free ordered graphs for all [13].
The results obtained by Hajebi et. al [13] are listed in Table 1. Let us make a few comments about implications between results. First, if is an unordered graph, then hardness for -free graphs implies hardness when we exclude any ordering of . Second, since we consider the list problem, an algorithm for List -Coloring implies an algorithm for List -Coloring and the hardness for List -Coloring implies the hardness for List -Coloring. Third, if is an induced subgraph of , then the algorithm for -free graphs implies the algorithm for -free graphs, and hardness for -free graphs implies hardness for -free graphs. Finally, if is an ordered graph obtained from by reversing the ordering of vertices, the complexity in -free and -free graphs is the same.
| Forbidden | |||
|---|---|---|---|
| [13] | Theorem 3 | ||
| [13] folklore | |||
| [13] | Theorem 5 | ? | |
| [13] | Theorem 11 | ||
| ? | Theorem 12 | ||
| ? | |||
| ? | ? | ? | |
| other | [13] |
In this paper we consider the complexity of List -Coloring for in ordered -free graphs. Let us briefly discuss our results, see also Table 1.
We show that if has one edge, then List -Coloring is polynomial-time-solvable in -free graphs, for any fixed ; see Theorem 3. This extends earlier result of Hajebi et al. [13] for . Even though our algorithm works for every , it is significantly simpler and has better complexity bound. Our approach is based on branching which allows us to obtain a family of “cleaned” instances that can be efficiently solved by dynamic programming.
We also show that List 4-Coloring can be solved in polynomial time for graphs that exclude a graph consisting of a copy of preceded by an arbitrary number of isolated vertices; see Theorem 5. This algorithm is much more involved than the one from Theorem 3 and is the main algorithmic contribution of the paper. It consists of a few phases of branching that again lead us to a “cleaned” instance. In such an instance we remove certain edges. We remark that in general such an operation is not safe in -free graphs as it might take us outside the class. However, we argue that in our case we can indeed do it. Finally, we reduce the problem to solving List 4-Coloring for a chordal graph, which can be done in polynomial time.
In stark contrast, in Theorem 11 we show that if is a graph consisting of a copy of , followed by a single isolated vertex, then List 4-Coloring is NP-hard in -free graphs. We remark that this is also where the complexity of List 4-Coloring differs from the complexity of List 3-Coloring. Indeed, the latter problem is in P in classes defined by forbidding any graph obtained by adding isolated vertices before and after a copy of .
Finally, in Theorem 12 we show that List 4-Coloring is NP-hard for -free graphs; this is one of the open cases for List 3-Coloring.
We also look at the closely related List Coloring problem, where the number of colors is not bounded; see Appendix. Unsurprisingly, this problem turns out to be NP-hard in -free graphs for all graphs with at least three vertices. If has two vertices, the problem is actually trivial.
The paper is concluded with several open questions and possible directions for further research.
Proofs of the statements marked with can be found in the full version of the paper.
2 Preliminaries
For a positive integer , by we denote the set . For two positive integers such that by we denote . For a set , by we denote the set of all subsets of , and by , where , we denote the set of all -element subsets of .
For , by we denote the Ramsey number of and , i.e., the minimum number such that every graph on vertices contains either a clique on vertices or an independent set on vertices. It is known that for every , the number exists [19].
Ordered graphs.
An ordered graph is a graph given with a linear ordering of its vertices. For two vertices , we write if appears the ordering earlier than .
We say that is a forward neighbor (resp., backward neighbor) of if and (resp., ). The set of forward (resp., backward) neighbors of is denoted by (resp., ).
Special graphs.
Let us define some special ordered graphs that will be crucial for us.
-
For a non-negative integer , the vertex set of consists of vertices , ordered so that for , and the edge set consists of one edge .
-
For a non-negative integer , the vertex set of consists of vertices , ordered so that for , and the edge set consists of one edge .
-
The vertex set of consists of three vertices ordered so that , and the edge set consists of two edges .
-
The vertex set of consists of four vertices ordered so that , and the edge set consists of two edges .
-
For a non-negative integer , the vertex set of consists of vertices ordered so that ordered so that for , and the edge set consists of two edges .
-
The vertex set of consists of four vertices , ordered so that , and the edge set consists of two edges .
A graph is chordal if it contains no cycle on at least vertices as an induced subgraph. The following observation by Hajebi et al. [13] will be useful.
Proposition 1 (Hajebi et al. [13]).
A graph is chordal if and only if there exists a linear ordering of such that (as an ordered graph) is -free.
List coloring.
The instance of the List Coloring problem is , where is a graph and is a list function. We ask whether admits a proper coloring such that every vertex receives a color from its list. For a fixed integer , the List -Coloring is a restriction of List Coloring, where every list is a subset of .
The following result of Edwards [8] will be useful for us.
Theorem 2 (Edwards [8]).
For every , there is a polynomial-time algorithm that solves every instance of List -Coloring such that for every , it holds .
3 Polynomial-time algorithms
In both algorithm presented in this section we will use two simple reduction rules. Let be an instance of List -Coloring for some .
-
(R1)
If there is such that , then return NO.
-
(R2)
For such that , remove from lists of all neighbors of , and remove from .
Clearly, the reduction rules are safe and their exhaustive application can be performed in polynomial time.
3.1 -free graphs where
In this section we prove the following result.
Theorem 3.
Let be a fixed ordered graph with one edge. For every , the List -Coloring problem is polynomial-time solvable in -free ordered graphs.
Proof.
Observe that every graph with one edge is an induced subgraph of , for some . Thus, it is sufficient to consider the case that . We can also assume that , as for the problem is trivial: all instances are edgeless.
We proceed by induction on ; the case is obvious. Thus suppose that and the claim holds for . Let be an -vertex instance of List -Coloring such that is an -free ordered graph.
Branching.
We first verify if there is a list coloring such that some color is used on at most vertices; for every , and for every of size at most , we create an instance from as follows:
-
1.
for every , we remove from all colors but ,
-
2.
for every , we set its list to ,
-
3.
we exhaustively apply reduction rules (R1) and (R2).
Note that now can be seen as an instance of List -Coloring, and thus, it can be solved in polynomial time by the inductive assumption.
So since now we can assume that for every list coloring , every color is used on at least vertices. Now we branch on the choice of first and last vertices in each color, i.e., for every -tuple of pairwise disjoint sets, each of size , where precedes , we create from an instance as follows:
-
1.
for every , for , we remove from all colors but ,
-
2.
for every , for every , if precedes the last vertex of or the first vertex of precedes , then we remove from ,
-
3.
we exhaustively apply reduction rules.
Consider such an instance . Let , and let be the set of vertices in with .
Claim 4 ().
For every , the graph is -free.
Dynamic programming.
So since now, we assume that we are dealing with an instance that satisfies the property from Claim 4. For simplicity, let us denote the current instance , omitting the subscript .
Let denote the vertices of . Moreover, for , we define . Let , let denote the family of all -tuples of pairwise disjoint independent subsets of , each of size at most . We say that a list coloring is compatible with if, for every , the following hold: if , then , and if , then is the set of last vertices of colored with .
For every , we will construct a table of entries, indexed by all elements of ; note that the total size of of all tables is bounded by . We will set to true if and only if there exists a list coloring of that is compatible with . Clearly, is a yes-instance of List -Coloring if and only if contains at least one true entry. So it remains to show how to compute the entries efficiently.
First, we set to true if and only if there is such that and for . So now assume that , we computed all entries for , and let . If there is no such that , we set to false. So now assume that such exists; clearly it is unique. We set to true if and only if at least one of following conditions is satisfied.
-
1.
is true.
-
2.
and there exists such that: (i) precedes all the vertices of , (ii) is non-adjacent to , and (iii) for , we have that is true.
Clearly, all table entries can be computed in polynomial time in .
Correctness.
The full proof of the correctness can be found in the full version of the paper (). Let us only mention how we use -freeness here. In general, it might happen that for some , there exists such that is an independent set and there is a coloring of compatible with , but such a coloring cannot be extended to by since there is some neighbor of such that . In our case, existence of such a vertex yields an induced copy of on vertices of , which contradicts Claim 4. This completes the proof.
3.2 -free graphs
Theorem 5.
For every fixed , List 4-Coloring can be solved in polynomial time on -free ordered graphs.
Proof.
Let be an ordered -vertex -free graph, given with a list function . We start with checking if contains a and, if so, we immediately reject the instance. This can be done in polynomial time by brute force.
First, suppose there is a list 4-coloring of such that for some , at most vertices receive color . We might exhaustively guess such an and the set of vertices colored , remove them from the graph, and remove from the lists of all remaining vertices. This way we reduced the problem to solving a polynomial number of instances of List 3-Coloring, each of which can be solved in polynomial time by using the result of Hajebi et al. [13, Theorem 22], mentioned in Table 1.
So, from now on let us focus on looking for a list 4-coloring, where each color appears at least times. The algorithm consists of four main phases.
Phase 1.
For each , we exhaustively guess the first vertices that will receive color . More precisely, for every 4-tuple of pairwise disjoint independent sets, each of size , we create an instance as follows.
-
1.
For every and every vertex , we set the list of to .
-
2.
For every , we remove from lists of all vertices not in that precede the last vertex of .
-
3.
We exhaustively apply reduction rules.
Observe that as we assumed that in any list 4-coloring of there are at least vertices in each color, is a yes-instance if and only if at least one of the created instances is a yes-instance. Furthermore, the number of branches in Phase 1 is at most , which is polynomial. Consider one such branch for and let be the current instance. Before we proceed to Phase 2, let us analyze the properties of .
Claim 6 ().
Let be such that induces a , where . Then .
Let us classify forward neighbors of a vertex . We say that a forward neighbor of is safe (in ) if , and otherwise it is dangerous. Now, for every vertex we can bound the number of its safe forward neighbors.
Claim 7 ().
Let and let . Then has at most forward neighbors whose list contains . Consequently, has at most safe forward neighbors.
We say that a vertex is bad if it has at least dangerous forward neighbors. If is not bad, then it is good. Let and denote, respectively, the sets of bad and good vertices.
Let us make a few comments about bad and good vertices. First, every has list of size . Indeed, the reduction rules assert that there are no vertices with lists of size at most one, and if the list of has at least three elements, then there are no vertices with lists disjoint with (and in particular has no dangerous forward neighbors). Second, for analogous reasons, all dangerous forward neighbors of a bad vertex have the same list, i.e., . Finally, if is good, ˜7 implies that has at most forward neighbors.
Claim 8 ().
Let be a bad vertex. Let be the set of all vertices with for which . Then is non-adjacent to at most vertices of .
Phase 2.
We proceed further with the instance . We consider two cases depending on the size of . First, if , then we can exhaustively guess coloring on . More precisely, for each we create a corresponding instance by setting the list of every to and then exhaustively applying reduction rules.
The number of instances created this way is at most , which is a constant as is fixed. Since every bad vertex has list of size , in any produced instance, every vertex must have a list of size . Here we emphasize that the vertices in the newly created instances might become good, but they were bad before the guessing and their lists could only shrink. Therefore, applying Theorem 2, we can solve each instance in polynomial time. This completes the proof in this case.
So since now, we can assume that . Let be the set of first good vertices. We exhaustively guess the coloring of , i.e., for every , we create a corresponding instance by setting the list of every to and applying reduction rules exhaustively.
Recall that every good vertex has at most forward neighbors, and thus the size of is bounded by . Therefore, the number of instances created in Phase 2 is at most , which is again constant for fixed .
Consider one such instance and denote it by . We partition the vertex set of into sets called prefix and suffix so that in are all vertices that in precede the last vertex of , and contains the remaining vertices of . Observe that all vertices in were bad at the end of Phase 1, i.e., before we guessed a coloring on . In the instance they do not have to be bad, but we do not care if they are bad now. We will only use the facts that (i) they have lists of size 2 and (ii) ˜8 holds for all vertices of . Indeed, note that reduction rules did not increase the size of lists or the number of non-neighbors.
Moreover, observe that the graph induced by is -free. Indeed, since all vertices of were not removed by reduction rules applied after the branching in Phase 2, there are no edges between and . Moreover, since has no , there is an independent set of size . Consequently, if contained an induced , then, together with , it would form an induced in , a contradiction. We proceed to the third phase.
Phase 3.
Let be an instance produced in Phase 2. For , by we denote the set of vertices of with list ; recall that each vertex of is bad and thus has list of size . If, for some , the set does not induce a bipartite graph, we can immediately terminate the current call and reject. So assume that, for each , the graph is bipartite. We consider two cases.
If , then we exhaustively guess the coloring of , i.e., for every , we create a corresponding instance by setting the list of every to and applying reduction rules exhaustively. The number of instances created in this case is at most , i.e., a constant.
Now let us assume that . Denote , and suppose that we are dealing with a yes-instance, i.e., there is a coloring of respecting lists . Observe that one of the following holds.
-
(C1)
For some , at most vertices of receive color in .
-
(C2)
Each of colors appears at least times on in .
We create the following instances, corresponding to the cases above.
-
(I1)
For every and every set of size at most , we create a corresponding instance by setting the list of every vertex to , and the list of every vertex to .
-
(I2)
For every pair , where are disjoint independent sets contained in , each of size , we create a corresponding instance in the following way: (i) for every vertex , we set its list to , (ii) for every vertex , we set its list to , and (iii) for every vertex of preceding the last vertex of , we remove from , and (iv) and for every vertex of preceding the last vertex of , we remove from .
We exhaustively apply reduction rules to all created instances. The number of instances created in this case is at most .
The intended role of the set (resp., ) in (I2) is that it contains the first vertices of colored (resp., ). If is a yes-instance, and there is coloring satisfying (C1), then at least one of the instances created in (I1) is a yes-instance, and if there is a coloring satisfying (C2), then at least one of the instances created in (I2) is a yes-instance. Thus, if is a yes-instances, then at least one of the instances created in Phase 3 is a yes-instance. The total number of instances created in this phase is at most , i.e., polynomial in .
Let us analyze an instance created in Phase 3. Recall that all vertices of have lists of size 2.
Claim 9 ().
For any two vertices , either or . In particular, at most two distinct lists might appear among the vertices of in .
We proceed to Phase 4. We emphasize that sets and Good are not redefined with respect to the current instance.
Phase 4.
Let be an instance given by Phase 3. By ˜9, there are at most two distinct lists on , and by symmetry, we can assume that every vertex of in has list either or . Furthermore, if for , we have , then corresponds to a branch of type (I1), i.e., a branch for the sets . Let be the set of vertices in that consists of safe forward neighbors of (if ) and safe forward neighbors of (if ).
For every , we create a corresponding instance as follows:
-
1.
for every , we set the list of to ,
-
2.
we exhaustively apply reduction rules,
-
3.
we remove all edges whose one endpoint has list and the other , and at least one endpoint is in .
By ˜7, each vertex has at most 12 safe forward neighbors and thus, we guess a coloring on at most vertices. Therefore, the number of instances created in this phase is at most . Note that the edges removed in the final step do not matter for coloring, so we obtain an equivalent instance. Let be an instance obtained in this phase. We point out that in general, if we remove edges in a (ordered) graph which is -free for some graph , it does not have to stay -free. However, in our case, we will show that the resulting graph is even -free.
Claim 10 ().
is -free.
Summing up, the instances obtained in Phase 4 are -free and thus chordal. Chordal graphs of bounded clique number have bounded treewidth, and thus, each obtained instance can be solved in polynomial time by standard dynamic programming on tree decomposition (see for example [6]). This completes the proof.
Let us conclude this section with brief discussion why the approach from Theorem 5 fails for more than 4 colors. In general, in List -Coloring, it is beneficial if adjacent vertices have intersecting lists. This way deciding on a color of one vertex allows to shrink the list of the other, see e.g. [18, 1]. On the other hand, adjacent vertices with disjoint lists of size at least 2 often appear in hardness proofs of List k-Coloring for , see Section 4 or, e.g., [1].
In the proof of Theorem 5, we called (forward) neighbors of with list disjoint from dangerous and dealing with them was the most technically involved part of the argument. The crucial property that was very useful here is that every dangerous forward neighbor of has the same list, i.e., . This enforces many constraints on possible lists of vertices.
Already for List 5-Coloring, a vertex can have several types of forward neighbors with list disjoint from , and this is the main obstacle in generalizing our approach to more than 4 colors.
4 Hardness results
The proof of the following theorem can be found in the full version of the paper.
Theorem 11 ().
List 4-Coloring is NP-hard on -free ordered graphs.
In this section we show the following hardness result.
Theorem 12.
List 4-Coloring is NP-hard on -free graphs.
The construction.
First, let us describe the main building blocks in our reduction. For positive integers , a link is a tuple , where is an ordered graph, and and are tuples of vertices of , such that:
-
1.
are, in this order, the first vertices of ,
-
2.
are, in this order, the last vertices of ,
-
3.
sets and are disjoint and independent,
-
4.
is -free.
The vertices (resp., ) are called input (resp., output) vertices of the link.
The properties of links allow us combine them, without creating the forbidden subgraph. This operation, that we call chaining, is formally described in the following lemma.
Lemma 13 ().
Let and be two links on disjoint sets of vertices. The ordered graph obtained from and by identifying with for each is a link.
In our reduction we will use gadgets that are links enriched by a list function. We will also speak about chaining gadgets – in such a situation, we always ensure that the lists of vertices that are identified are equal. Thus, the operation is straightforward.
The main gadget used in our hardness proof is a NAE gadget.
Definition 14 (NAE gadget).
Let and let be a set of pairwise disjoint subsets of , each of size . A NAE gadget (for ) is a tuple , where is a link and is a list function, such that:
-
(C1)
For every , it holds that .
-
(C2)
For every such that for every , it holds that , we can extend to a coloring of .
-
(C3)
For every coloring of , it holds that:
-
(a)
for every , ,
-
(b)
for every , it holds that
-
(a)
For simplicity of notation, we will denote the gadget by .
Intuitively, the gadget plays two roles. First, it transfers the coloring of input vertices to their corresponding output vertices. Second, it makes sure that for every triple in , the input/output vertices corresponding to that triple are not monochromatic or, in other words, not all equal (NAE). The following lemma is the main technical ingredient of our hardness proof.
Lemma 15.
Let and let be a set of pairwise disjoint subsets of , each of size . In time polynomial in , we can construct a NAE gadget for .
Let us postpone the proof of Lemma 15, and first let us show Theorem 12 assuming that Lemma 15 holds.
Proof of Theorem 12.
We reduce from Positive NAE--Sat. An instance of this problem consists of a set of boolean variables and a set of clauses, each containing exactly three variables (none of them is negated). We ask if there exists a truth assignment in which each clause contains a true and a false variable, i.e., for each clause, the variables in it are not all equal.
Let be an instance of Positive NAE--Sat with variables and clauses . We can assume that every variable appears at most four times [7]. In polynomial time, we will construct an instance of List 4-Coloring such that:
-
1.
is an ordered -free graph,
-
2.
admits a proper coloring if and only if is satisfiable.
As each clause has three variables and each variable appears in at most four clauses, we can greedily partition the set of clauses into 10 pairwise disjoint subsets; denote them by (we can think of this as a greedy edge coloring of a hypergraph: for each hyperedge, each its vertex blocks at most three colors). For , we define so that , if and only if there is a clause in .
Now we are ready to construct the instance . We start with introducing NAE gadgets , for, respectively, . For , let us denote the input (resp., output) vertices of by by (resp., ). Next, we chain gadgets , i.e., for every , we identify the output vertices of with input vertices of . This completes the construction of .
As each gadget is in particular a link, a repeated application of Lemma 13 yields that is -free. Thus, we are left with proving the equivalence of instances.
Suppose that is satisfiable and let be a satisfying assignment. For every , we set if , and if . Since for every clause , we have , and thus, for every we have , we can extend this coloring to a coloring of the whole gadget . Since for every , we have that , we can repeat the reasoning inductively for every and extend to all vertices of .
Now suppose that there is a proper coloring of . We define so that if and if . Let us verify that satisfies . Suppose that there is a clause which is not satisfied, i.e., all are either set true or set false by . By property (C3) (a), this means that for every , we have . As for some , we obtain a contradiction with property (C3) (b) of a NAE gadget. This completes the proof.
From NOT- gadgets to NAE gadgets.
We will construct NAE gadgets in several steps. First, let us show that in order to construct a NAE gadget, it is sufficient to construct its restricted variant, called NOT- gadget.
Definition 16 (NOT- gadget).
Let . Let and let be a set of pairwise disjoint subsets of , each of size . A NOT- gadget (for ) is a tuple , where is a link and is a list function, such that:
-
(C1)
For every , it holds that .
-
(C2)
For every such that for every , it holds that , we can extend to a coloring of .
-
(C3)
For every coloring of , it holds that:
-
(a)
for every , ,
-
(b)
for every , it holds that
-
(a)
As usual, we will simply denote the gadget by .
Let us emphasize the difference between a NAE gadget and a NOT- gadget. The first one is responsible for ensuring that for each triple in , the colors assigned to the corresponding vertices are not all 1 and not all 2. The role of a NOT- gadget is to ensure that the vertices corresponding to each triple in are not all colored , where . Thus, a NAE gadget is simultaneously a NOT-111 gadget and a NOT-222 gadget.
As the gadget not only forbids some colorings, but also copies the coloring of the input to the output, we immediately obtain the following observation.
Observation 17.
Chaining a NOT-111 gadget and a NOT-222 yields a NAE gadget.
Thus, in order to prove Lemma 15, it is sufficient to build a NOT- gadget for .
Permutation gadgets.
On the way to the proof of Lemma 15, we will first construct another type of a gadget.
Definition 18 (Permutation gadget).
Let , and let be a permutation. A permutation gadget (for ) is a tuple , where is a link and is a list function, such that:
-
(P1)
For every , it holds that .
-
(P2)
Every mapping can be extended to a coloring of .
-
(P3)
For every coloring of , for every , it holds that .
Again, we will shortly denote a permutation gadget for by . Intuitively, the role of a permutation gadget is to transfer the coloring of the input to the output, but after applying on it. We will show that we can efficiently construct permutation gadgets.
Lemma 19.
Let , and let be a permutation. In time polynomial in , we can construct a permutation gadget for .
Let us break the proof of Lemma 19 in three steps.
First, we observe that that chaining permutation gadgets yields a permutation gadget for the composition of permutations: this follows directly from Lemma 13 and the definition of a permutation gadget.
Observation 20.
For , let be two permutations and let be their corresponding permutation gadgets. Let be obtained by chaining with . Then, is a permutation gadget for .
Thus, in order to show Lemma 19, it is enough to construct permutation gadgets for some basic permutations that can be composed into an arbitrary permutation. These basic permutations are rotations. For integers , a rotation, denoted by is a permutation of such that:
In other words, performs a cyclic shift on elements , leaving the remaining ones untouched. In particular, if , then is an identity.
Observation 21 ().
Every permutation can be written as the composition of rotations.
Thus, in order to prove Lemma 19, it is sufficient to show how to construct permutation gadgets for rotations. We do this in the next lemma, consult also Figure 1.
Lemma 22.
Let be integers. In time polynomial in , we can construct a permutation gadget for .
Proof.
The gadget has vertices. We partition them into five sets such that and in a natural way: the first vertices belong to , next vertices belong to and so on. For , the -th vertex of is denoted by .
The lists of vertices of the gadget are as follows:
The edge set of the gadget consists of the following elements:
- Between and :
-
for and for ,
- Between and :
-
for and for ,
- Inside :
-
for ,
- Between and :
-
for and for and , and for ,
- Between and :
-
for and for .
This completes the construction of the gadget : the input vertices are and the output vertices are . It can be shown that satisfies the desired properties (), which completes the proof.
Now, Lemma 19 follows directly from Observation 20, Observation 21, and Lemma 22,
Indicator gadgets.
The next type of a gadget that we will need is an indicator.
Throughout this paragraph, let and let be a set of pairwise disjoint pairs from of , each of the form , and let . Let us define a bijection . We will do it by specifying the relative order of images of particular elements of . The images of elements in are in the natural order, i.e., . For each , the image of this pair is placed between and . Note that, as the pairs in are of the form , is well-defined.
Definition 23 (Indicator gadget).
Let . An indicator gadget (for and ) is a tuple , where is a link and is a list function, such that:
-
(I1)
For every and , it holds that .
-
(I2)
Every can be extended to a coloring of the gadget so that the following holds. For every , if , then .
-
(I3)
For every coloring of the gadget, the following holds. For every , we have , and for every , if , then .
Note that each output vertex of the gadget corresponds either to an input vertex, or to a pair in ; this correspondence is given by . The gadget plays two roles. First, the coloring of input vertices is copied to their corresponding output vertices. Second, for each pair in , the color of its corresponding output vertex indicates if both input vertices representing this pair are colored .
In the following lemma we show how to construct indicator gadgets; consult also Figure 2.
Lemma 24.
Let , let and let be a set of pairwise disjoint pairs from of , each of the form . In time polynomial in , we can construct an indicator gadget for , and .
Proof.
By symmetry, assume that . Let be the function defined for and as before.
The vertex set of the gadget is partitioned into five sets , where, for all , all vertices of precede all vertices from . We will construct the sets one by one.
- Set :
-
We start with introducing the vertices (in that order), all with list .
- Set :
-
Next, we introduce vertices (in that order), all with list . Next, for every , we add vertices , with lists, respectively, and . We position them in the order so that . For every , we add the edge , and for every , we add edges and .
- Set :
-
We introduce vertices (in that order), all with list . For every , we add a vertex , with list . We insert between and . For every , we add the edge , and for every , we add edges and .
- Set :
-
We introduce vertices (in that order), all with list . For every , we add vertex with list . We insert between and . For every , we add the edge , and for every , we add the edge .
- Set :
-
We introduce vertices (in that order), all with list . For every , we add a vertex with list . We insert between and . For every , we add the edge , and for every , we add the edge .
This completes the construction of ; the input vertices are and the output vertices are . Note that, for each , the -th output vertex is , and for each , the -th output vertex is . It can be verified that satisfies the desired properties (), which completes the proof.
NOT- gadgets.
The last type of a gadget is a NOT- gadget, for .
Throughout this paragraph, let and let be a set of pairwise disjoint pairs from of , each of the form . Let ; note that . Let be an injection defined as follows. The image of this function is the set of these , for which . Furthermore, we have . Note that is well-defined.
Definition 25 (NOT-).
Let . An NOT- gadget (for and ) is a tuple , where is a link and is a list function, such that:
-
(B1)
For every and , it holds that .
-
(B2)
Every such that for every it holds that , can be extended to a coloring of the gadget.
-
(B3)
For every coloring of the gadget, the following holds. For every , we have , and for every we have .
Note that there are two types of input vertices: those for which , and the remaining ones. The former ones have corresponding output vertices; this correspondence is given by . The remaining input vertices do not have corresponding output vertices.
Again, the gadget plays two roles. First, it transfers the coloring of input vertices of the first type to their corresponding output vertices. Second, for each pair in , the gadget ensures that input vertices corresponding to that pair are not both colored .
The construction of NOT- gadgets is quite similar to the one for indicator gadget, so we omit here the proof of the following lemma.
Lemma 26 ().
Let , let and let be a set of pairwise disjoint pairs from of , each of the form . Let . In time polynomial in , we can construct a NOT- gadget for .
Constructing NOT- gadgets.
Finally, we can prove the following statement, which would finish the proof of Lemma 15 and thus, of Theorem 12.
Lemma 27 ().
Let , let and let be a set of pairwise disjoint subsets of , each of size . In time polynomial in , we can construct a NOT- gadget for .
The proof of Lemma 27 can be found in the full version of the paper. Let us just present here the general idea of our approach. Let be the input vertices of the gadget. The gadget is supposed to forbid some triples of vertices to be colored only with color 1. However, doing this directly seems difficult, while keeping -freeness. Thus, we do it in two steps.
For each triple , we create a new vertex , so that if both vertices and are colored , then the color of is forced to be , and otherwise can be colored with the other color in . This is precisely the behavior that can be forced by an indicator gadget. Then we make sure that and (actually, a vertex whose color is equal to the color of ; here we use the second role of an indicator) are not both colored . This can be done using the NOT- gadget.
There is one last thing to do: recall that the indicator and the NOT- gadgets can only operate on pairs of consecutive vertices, and do not have to be consecutive. However, this can be easily obtained by reshuffling the vertices using appropriate permutation gadgets.
Summing up, the NOT- is obtained by chaining a permutation gadget, an indicator gadget, another permutation gadget, a NOT- gadget, and, finally, yet another permutation gadget, to restore the original ordering of vertices.
Now, Lemma 15 follows directly by combining Lemma 27 and Observation 17. This completes the proof of Theorem 12.
5 Conclusion
Let us conclude the paper with pointing out some possible directions for future research. An obvious one is to fill the gaps in Table 1. We believe obtaining a full dichotomy here is much easier than the analogous question for unordered graphs. In particular, we believe that understanding the complexity of List -Coloring for in -free ordered graphs is a specific and intriguing problem.
Second, we believe it is interesting to investigate the complexity of the (non-list) -Coloring problem in hereditary classes of ordered graphs. While algorithms for List -Coloring clearly carry over to -Coloring this is not the case for hardness reductions. Note that our proofs crucially use lists, and a standard way of simulating lists by adding a -clique and using the edges to this clique to forbid certain colors introduces new induced subgraphs.
On the other hand, the reduction in Theorem 12 is quadratic, and thus, it only excludes algorithms with running time , where is the number of vertices of the input. The bottleneck is the construction of a permutation gadget, which has vertices. It would be interesting to improve this construction to a linear one, or provide a subexponential-time algorithm for the problem.
References
- [1] Édouard Bonnet and Paweł Rzążewski. Optimality program in segment and string graphs. Algorithmica, 81(7):3047–3073, 2019. doi:10.1007/S00453-019-00568-7.
- [2] Flavia Bonomo, Maria Chudnovsky, Peter Maceli, Oliver Schaudt, Maya Stein, and Mingxian Zhong. Three-coloring and list three-coloring of graphs without induced paths on seven vertices. Comb., 38(4):779–801, 2018. doi:10.1007/S00493-017-3553-8.
- [3] Maria Chudnovsky, Sepehr Hajebi, and Sophie Spirkl. List--Coloring -Free Graphs for All . Comb., 44(5):1063–1068, 2024. doi:10.1007/S00493-024-00106-2.
- [4] Maria Chudnovsky, Shenwei Huang, Sophie Spirkl, and Mingxian Zhong. List 3-coloring graphs with no induced . Algorithmica, 83(1):216–251, 2021. doi:10.1007/S00453-020-00754-Y.
- [5] Jean-François Couturier, Petr A. Golovach, Dieter Kratsch, and Daniël Paulusma. List coloring in the absence of a linear forest. Algorithmica, 71(1):21–35, 2015. doi:10.1007/S00453-013-9777-0.
- [6] Marek Cygan, Fedor V. Fomin, Lukasz Kowalik, Daniel Lokshtanov, Dániel Marx, Marcin Pilipczuk, Michal Pilipczuk, and Saket Saurabh. Parameterized Algorithms. Springer, 2015. doi:10.1007/978-3-319-21275-3.
- [7] Andreas Darmann and Janosch Döcker. On simplified NP-complete variants of Not-All-Equal 3-Sat and 3-Sat. CoRR, abs/1908.04198, 2019. arXiv:1908.04198.
- [8] Keith Edwards. The complexity of colouring problems on dense graphs. Theor. Comput. Sci., 43:337–343, 1986. doi:10.1016/0304-3975(86)90184-2.
- [9] Thomas Emden-Weinert, Stefan Hougardy, and Bernd Kreuter. Uniquely colourable graphs and the hardness of colouring graphs of large girth. Comb. Probab. Comput., 7(4):375–386, 1998. URL: http://journals.cambridge.org/action/displayAbstract?aid=46667.
- [10] Esther Galby, Paloma T. Lima, Andrea Munaro, and Amir Nikabadi. Maximum list -colorable induced subgraphs in -free graphs. In Anne Benoit, Haim Kaplan, Sebastian Wild, and Grzegorz Herman, editors, 33rd Annual European Symposium on Algorithms, ESA 2025, Warsaw, Poland, September 15-17, 2025, volume 351 of LIPIcs, pages 40:1–40:13. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2025. doi:10.4230/LIPICS.ESA.2025.40.
- [11] Petr A. Golovach, Daniël Paulusma, and Jian Song. Closing complexity gaps for coloring problems on H-free graphs. Inf. Comput., 237:204–214, 2014. doi:10.1016/J.IC.2014.02.004.
- [12] Sepehr Hajebi, Yanjia Li, and Sophie Spirkl. Complexity dichotomy for list-5-coloring with a forbidden induced subgraph. SIAM J. Discret. Math., 36(3):2004–2027, 2022. doi:10.1137/21M1443352.
- [13] Sepehr Hajebi, Yanjia Li, and Sophie Spirkl. List-3-Coloring ordered graphs with a forbidden induced subgraph. SIAM J. Discret. Math., 38(1):1158–1190, 2024. doi:10.1137/22M1515768.
- [14] Chính T. Hoàng, Marcin Kamiński, Vadim V. Lozin, Joe Sawada, and Xiao Shu. Deciding k-colorability of -free graphs in polynomial time. Algorithmica, 57(1):74–81, 2010. doi:10.1007/S00453-008-9197-8.
- [15] Ian Holyer. The NP-completeness of edge-coloring. SIAM J. Comput., 10(4):718–720, 1981. doi:10.1137/0210055.
- [16] Shenwei Huang. Improved complexity results on -coloring -free graphs. Eur. J. Comb., 51:336–346, 2016. doi:10.1016/J.EJC.2015.06.005.
- [17] Daniel Leven and Zvi Galil. NP completeness of finding the chromatic index of regular graphs. J. Algorithms, 4(1):35–44, 1983. doi:10.1016/0196-6774(83)90032-9.
- [18] Marcin Pilipczuk, Michał Pilipczuk, and Paweł Rzążewski. Quasi-polynomial-time algorithm for independent set in -free graphs via shrinking the space of induced paths. In Hung Viet Le and Valerie King, editors, 4th Symposium on Simplicity in Algorithms, SOSA 2021, Virtual Conference, January 11-12, 2021, pages 204–209. SIAM, 2021. doi:10.1137/1.9781611976496.23.
- [19] Frank Plumpton Ramsey. On a problem of formal logic. Proceedings of the London Mathematical Society, 30(1):264–286, 1930. doi:10.1112/plms/s2-30.1.264.
