Coloring Digraphs
Coloring Digraphs
Abstract In k-Digraph Coloring we are given a digraph and are asked to par-
tition its vertices into at most k sets, so that each set induces a DAG. This well-
known problem is NP-hard, as it generalizes (undirected) k-Coloring, but be-
comes trivial if the input digraph is acyclic. This poses the natural parameterized
complexity question of what happens when the input is “almost” acyclic. In this
paper we study this question using parameters that measure the input’s distance
to acyclicity in either the directed or the undirected sense.
In the directed sense perhaps the most natural notion of distance to acyclicity
is directed feedback vertex set (DFVS). It is already known that, for all k ≥ 2, k-
Digraph Coloring is NP-hard on digraphs of DFVS at most k + 4. We strengthen
this result to show that, for all k ≥ 2, k-Digraph Coloring is already NP-hard for
DFVS exactly k. This immediately provides a dichotomy, as k-Digraph Coloring
is trivial if DFVS is at most k − 1. Refining our reduction we obtain three further
consequences: (i) 2-Digraph Coloring is NP-hard for oriented graphs of feedback
vertex set (FVS) at most 3; (ii) for all k ≥ 2, k-Digraph Coloring is NP-hard for
graphs of feedback arc set (FAS) at most k2 ; interestingly, this leads to a second
dichotomy, as we show that the problem is FPT by k if FAS is at most k2 − 1;
(iii) k-Digraph Coloring is NP-hard for graphs of DFVS k, even if the maximum
degree ∆ is at most 4k − 1; we show that this is also almost tight, as the problem
becomes FPT for DFVS k and ∆ ≤ 4k − 3.
Since these results imply that the problem is also NP-hard on graphs of bounded
directed treewidth, we then consider parameters that measure the distance from
acyclicity of the underlying graph. On the positive side, we show that k-Digraph
Coloring admits an FPT algorithm parameterized by treewidth, whose parameter
dependence is (tw!)ktw . Since this is considerably worse than the ktw dependence
of (undirected) k-Coloring, we pose the question of whether the tw! factor can be
eliminated. Our main contribution in this part is to settle this question in the neg-
Michael Lampis was partially supported by a grant from the French National Research Agency
under the JCJC program (ASSK: ANR-18-CE40-0025-01).
ative and show that our algorithm is essentially optimal, even for the much more
restricted parameter treedepth and for k = 2. Specifically, we show that an FPT
algorithm solving 2-Digraph Coloring with dependence tdo(td) would contradict
the ETH.
In the end, we consider the class of tournaments. It is known that deciding
whether a tournament is 2-colorable is NP-complete.√ We present an algorithm
that decides if we can 2-color a tournament in O∗ ( 3 6n ) time.
Keywords Digraph Coloring · Dichromatic number · NP-completeness ·
Parameterized complexity · Feedback vertex and arc sets
CR Subject Classification Mathematics of computing→Graph algorithms ·
Theory of Computation → Design and Analysis of Algorithms → Parameterized
Complexity and Exact Algorithms
1 Introduction
In Digraph Coloring, we are given a digraph D and are asked to calculate the
smallest k such that the vertices of D can be partitioned into k acyclic sets. In
other words, the objective of this problem is to color the vertices with the minimum
number of colors so that no directed cycle is monochromatic. This notion is called
the dichromatic number and it was introduced by V. Neumann-Lara [37]. More
recently, digraph coloring has received much attention, in part because it turns
out that many results about the chromatic number of undirected graphs quite
naturally carry over to the dichromatic number of digraphs [1, 2, 4, 7, 11, 20–24, 32,
34, 35, 38]. We note that Digraph Coloring generalizes Coloring (if we simply
replace all edges of a graph by pairs of anti-parallel arcs) and is therefore NP-
complete.
In this paper we are interested in the computational complexity of Digraph
Coloring from the point of view of structural parameterized complexity1 . Our
main motivation for studying this is that (undirected) Coloring is a problem
of central importance in this area whose complexity is well-understood, and it
is natural to hope that some of the known tractability results may carry over
to digraphs – especially because, as we mentioned, Digraph Coloring seems to
behave as a very close counterpart to Coloring in many respects. In particular,
for undirected graphs, the complexity of Coloring for “almost-acyclic” graphs is
very precisely known: for all k ≥ 3 there is a O∗ (ktw ) algorithm, where tw is the
input graph’s treewidth, and this is optimal (under the SETH) even if we replace
treewidth by much more restrictive parameters [27, 33]. Can we achieve the same
amount of precision for Digraph Coloring?
Our results: The main question motivating this paper is therefore the following:
Does Digraph Coloring also become tractable for “almost-acyclic” inputs? We
attack this question from two directions.
First, in Section 3, we consider the notion of acyclicity in the digraph sense and
study cases where the input digraph is close to being a DAG. Possibly the most
1 In the remainder, we assume the reader is familiar with the basics of parameterized com-
plexity theory, such as the class FPT, as given in standard textbooks [12].
Digraph Coloring and Distance to Acyclicity 3
natural such measure is directed feedback vertex set (DFVS), which is the mini-
mum number of vertices whose removal destroys all directed cycles. The problem
is paraNP-hard for this parameter, as for all fixed k ≥ 2, k-Digraph Coloring is
already known to be NP-hard, for inputs of DFVS at most k + 4 [34]. Our first
contribution is to tighten this result by showing that actually k-Digraph Color-
ing is already NP-hard for DFVS of size exactly k. This closes the gap left by the
reduction of [34] and provides a complete dichotomy, as the problem is trivially
FPT by k when the DFVS has size strictly smaller than k (the only non-trivial
part of the problem in this case is to find the DFVS [10]). In the end of this section
we consider 2-Digraph Coloring on oriented graphs. We prove that it is NP-hard
to decide if an oriented graph is 2-colorable even in cases where the size of DFVS
is 3. This is tight as there exists an easy argument showing that all oriented graphs
with DFVS k are k-colorable.
In Section 4 we investigate if by considering a more restricted notion of near-
acyclicity, or by imposing further restrictions, such as bounding the maximum
degree of the graph, could lead to an FPT algorithm. Unfortunately, we show
that neither of these suffices to make the problem tractable. In particular, by
refining our reduction we obtain the following: First, we show that for all k ≥ 2,
k-Digraph Coloring is NP-hard for digraphs of feedback arc set (FAS) k2 , that
is, digraphs where there exists a set of k2 arcs whose removal destroys all cycles
(feedback arc set is of course a more restrictive parameter than feedback vertex
set). Interestingly, this also leads us to a complete dichotomy, this time for the
parameter FAS: we show that k-coloring becomes FPT (by k) on graphs of FAS at
most k2 − 1, by an argument that reduces this problem to coloring a subdigraph
with at most O(k2 ) vertices, and hence the correct complexity threshold for this
parameter is k2 . Second, we show that k-coloring a digraph with DFVS k remains
NP-hard even if the maximum degree is at most 4k − 1. This further strengthens
the reduction of [34], which showed that the problem is NP-hard for bounded
degeneracy (rather than degree). Almost completing the picture, we show that k-
coloring a digraph with DFVS k and maximum degree at most 4k − 3 is FPT by k,
leaving open only the case where the DFVS is exactly k and the maximum degree
exactly 4k − 2.
In Section 5, because of the negative results for DFVS and FAS, we deiced to
consider as parameter the treewidth of the underlying graph. It turns out that,
finally, this suffices to lead to an FPT algorithm, obtained with standard DP
techniques. However, our algorithm has a somewhat disappointing running time
of (tw!)ktw nO(1) , which is significantly worse than the ktw nO(1) complexity which
is known to be optimal for undirected Coloring, especially for small values of k.
This raises the question of whether the extra (tw!) factor can be removed. Our
main contribution in this part is to show that this is likely impossible, even for a
more restricted case. Specifically, we show that if the ETH is true, no algorithm
can solve 2-Digraph Coloring in time tdo(td) nO(1) , where td is the input graph’s
treedepth, a parameter more restrictive than treewidth (and pathwidth). As a
result, this paper makes a counterpoint to the line of research that seeks to find
ways in which dichromatic number replicates the behavior of chromatic number in
the realm of digraphs by pinpointing one important aspect where the two notions
are quite different, namely their complexity with respect to treewidth.
Finally, in Section 6, we consider tournaments. It is already known that 2-
Digraph Coloring is NP-hard for tournaments [11]. The exhaustive algorithm to
4 A. Harutyunyan, M. Lampis, and N. Melissinos
We use standard graph-theoretic notation. All digraphs are loopless and have
no parallel arcs; two oppositely oriented arcs between the same pair of vertices,
however, are allowed and are called a digon. Oriented graphs are digraphs which
do not contain any digons. The in-degree (respectively, out-degree) of a vertex is
the number of arcs coming into (respectively going out of) a vertex. The degree
of a vertex is the sum of its in-degree and out-degree. For a set of arcs F , V (F )
denotes the set of their endpoints. For a set of vertices S of a digraph D, D[S ]
denotes the digraph induced by S and N [S ] denotes the closed neighborhood of S ,
that is, S and all vertices that have an arc to or from S .
The chromatic number of a graph G is the minimum number of colors k needed
to color the vertices of G such that each color class is an independent set. We say
that a digraph D = (V, E ) is k-colorable if we can color the vertices of D with k
colors such that each color class induces an acyclic subdigraph (such a coloring
is called a proper k-coloring ). The dichromatic number, denoted by χ(D), is the
2 Note that this argument does not prove that 2-Digraph Coloring is NP-hard for maxi-
mum degree 6, but this is not too hard to show. We give a proof in Theorem 1 for the sake of
completeness.
Digraph Coloring and Distance to Acyclicity 5
Remark 1 Every digraph D = (V, E ) with feedback vertex set of size at most k − 1
is k-colorable.
The remark holds because we can use distinct colors for the vertices of the
feedback vertex set and the remaining color for the rest of the graph.
A subset of arcs A ⊂ E of D is called a feedback arc set if D − A is acyclic.
For the definition of treewidth and nice tree decompositions we refer the reader
to [12]. A graph G has treedepth at most k if one of the following holds: (i) G has
at most k vertices (ii) G is disconnected and all its components have treedepth at
most k (iii) there exists u ∈ V (G) such that G − u has treedepth at most k − 1. We
use tw(G), td(G) to denote the treewidth and treedepth of a graph. It is known
that tw(G) ≤ td(G) for all graphs G.
The Exponential Time Hypothesis (ETH) [26] states that there is a constant
c > 1 such that no algorithm which decides if 3-SAT formulas with n variables
and m clauses are satisfiable can run in time cn+m . In this paper we will use the
simpler (and slightly weaker) version of the ETH which simply states that 3-SAT
cannot be solved in time 2o(n+m) .
Throughout the paper, when n is a positive integer we use [n] to denote the
set {1, . . . , n}. For a set V an ordering of V is an injective function σ : V → [|V |].
It is a well-known fact that a digraph D is acyclic if and only if there exists an
ordering σ of V (D) such that for all arcs uv we have σ (u) < σ (v ). This is called a
topological ordering of D.
We conclude this section with a preliminary theorem. As we mentioned, the
argument from (undirected) graph coloring that shows why k-Digraph Coloring
is NP-hard for digraphs of ∆ = 2k + 2 does not hold for k = 2. Our first theorem
gives a proof for this case.
for each vertex of the assignment part we connect it with digons with each vertex
of the satisfaction part that represents the opposite literal.
The digraph we constructed has maximum degree 6; indeed, each literal has
degree two in the assignment part and since each literal appears in at most two
clauses, it has degree at most 4 in the satisfaction part. If there is a satisfying
assignment then we give color 1 to all True literals of both parts and color 2 to
everything else. Observe that all arcs connecting the two parts are bichromatic
and if the assignment is satisfying all directed cycles are also bichromatic. For
the converse direction, if there is a 2-coloring we can extract an assignment by
setting to True all literals which have color 1 in the assignment part. Note that
this implies that in the satisfaction part all literals which have color 1 have been
set to True and all literals which have color 2 have been set to False, because of the
digons connecting the two parts. But this implies that our assignment is satisfying
because all cycles are bichromatic.
In this section we study the complexity of the problem parameterized by the size of
the feedback vertex set of a digraph. Throughout we will assume that a feedback
vertex set is given to us; if not we can use known FPT algorithms to find the
smallest such set [10].
As we are mentioned already, a digraph of DFVS k − 1 can be always colored
with k colors. Our main result in this section is that k-Digraph Coloring is NP-
hard for digraphs of DFVS k. Observe that Remark 1 indicates that this result
will be best possible.
Remark 2 Let D = (V, E ) be a digraph with feedback vertex set F of size |F | = k.
If F does not induce a bi-directed clique, then D is k-colorable.
Indeed, if u, v ∈ F are not connected by a digon we can use one color for {u, v},
k − 2 distinct colors for the rest of F , and the remaining color for the rest of the
graph. Remark 2 will also be useful later in designing an algorithm, but at this
point it is interesting because it tells us that, since the graphs we construct in our
reduction have DFVS k and must in some cases have χ(D) > k, our reduction
needs to construct a bi-directed clique of size k.
Before we go on to our reduction let us also mention that we will reduce from
a restricted version of 3-SAT with the following properties: (i) all clauses must
have either only positive literals or only negative literals (ii) all variables appear
at most 2 times positive and 1 time negative. We call this Restricted-3-SAT.
Lemma 1 Restricted-3-SAT is NP-hard and cannot be solved in 2o(n+m) time un-
less the ETH is false.
Proof Start with an arbitrary instance φ of 3-SAT with n variables and m clauses.
We first make sure that every variable appears at most 3 times as follows. First
use the trick of Lemma 1 to decrease the number of appearances of each literal to
two. We now edit φ0 as follows: for each variable x of φ0 we replace every occurence
of ¬x with a fresh variable x0 . We then add the clause (¬x ∨ ¬x0 ). This gives a new
equivalent instance φ00 which also has O(n + m) variables and clauses and satisfies
all properties of Restricted-3-SAT.
Digraph Coloring and Distance to Acyclicity 7
Proof We will prove the theorem for k = 2. To obtain the proof for larger values
one can add to the construction k − 2 vertices which are connected to everything
with digons: this increases both the dichromatic number and the feedback vertex
set by k − 2. Note that this does indeed construct a “palette” clique of size k, as
indicated by Remark 2.
We make a reduction from Restricted-3-SAT, which is NP-hard by Lemma 1.
Our reduction will produce an instance of size linear in the input formula, which
leads to the ETH-based lower bound. Let φ be the given formula with variables
x1 , . . . , xn , and suppose that clauses c1 , . . . , c` contain only positive literals, while
clauses c`+1 , . . . , cm contain only negative literals. We will assume without loss of
generality that all variables appear in φ both positive and negative (otherwise φ
can be simplified).
We begin by constructing two “palette” vertices v1 , v2 which are connected by
a digon. Then, for each clause ci , i ∈ [m] we do the following: if the clause has size
three we construct a directed path with vertices li,1 , wi,1 , li,2 , wi,2 , li,3 , where the
vertices li,1 , li,2 , li,3 represent the literals of the clause; if the clause has size two we
similarly construct a directed path with vertices li,1 , wi,1 , li,2 , where again li,1 , li,2
represent the literals of the clause.
For each variable xj , j ∈ [n] we do the following: for each clause ci1 where xj
appears positive and clause ci2 where xj appears negative we construct a vertex
0
wj,i 1 ,i2
and add an incoming arc from the vertex that represents the literal xj in
0 0
the directed path of ci1 to wj,i 1 ,i2
; and an outgoing arc from wj,i 1 ,i2
to the vertex
that represents the literal ¬xj in the directed path of ci2 .
Finally, to complete the construction we connect the palette vertices to the
rest of the graph as follows: v1 is connected with a digon to all existing vertices
0
wi,j , i ∈ [m], j ∈ [2]; v2 is connected with a digon to all existing vertices wj,i 1 ,i2
; v2
has an outgoing arc to the first vertex of each directed path representing a clause
and an incoming arc from the last vertex of each such path; v1 has an outgoing arc
to all vertices that represent positive literals and an incoming arc from all vertices
representing negative literals. (See Figure 1)
v1 v2 v1 v2 x1 w1,1 x2 w1,2 x3
0
w1,1,2 0
w2,1,2
0
li,1 wi,1 li,2 wi,2 li,3 l 0 = xj wj,i 1 ,i2
l = ¬xj ¬x1 w2,1 ¬x2
Fig. 1 (α): The cycles created by {v1 , v2 } and clauses with three literals. (β): The cycles
created by {v1 , v2 } and each pair {x, ¬x}. (γ): An example digraph for the formula φ =
(x1 ∨ x2 ∨ x3 ) ∧ (¬x1 ∨ ¬x2 ), without showing v1 , v2 .
8 A. Harutyunyan, M. Lampis, and N. Melissinos
Let us now prove that this reduction implies the theorem. First, we claim that
in the digraph we constructed {v1 , v2 } is a feedback vertex set. Indeed, suppose we
remove these two vertices. Now every arc in the remaining graph either connects
0
vertices that represent the same clause, or is incident on a vertex wj,i 1 ,i2
. Observe
that these vertices have only one incoming and one outgoing arc and because of
the ordering of the clauses i1 < i2 (since clauses that contain negative literals come
later in the numbering). We conclude that every directed path must either stay
inside the path representing the same clause or lead to a path the represents a
later clause. Hence, the digraph is acyclic.
Let us now argue that if φ is satisfiable then the digraph is 2-colorable. We give
0
color 1 to v1 and 2 to v2 . We give color 2 to each wi,j and color 1 to each wj,i 1 ,i2
.
Fix a satisfying assignment for φ. We give color 1 to all vertices li,j that represent
literals set to True by the assignment and color 2 to all remaining vertices. Let
0
us see why this coloring is acyclic. First, consider a vertex wj,i 1 ,i2
. This vertex
has color 1 and one incoming and one outgoing arc corresponding to opposite
0
literals. Because the literals are opposite, one of them has color 2, hence wj,i 1 ,i2
cannot be in any monochromatic cycle and can be removed. Now, suppose there
is a monochromatic cycle of color 1. As {v1 , v2 } is a feedback vertex set, this cycle
must include v1 . Since v2 and all wi,j have color 2 the vertex after v1 in the cycle
must be some li,j representing a positive literal which was set to True by our
assignment. The only outgoing arc leaving from li,j and going to a vertex of color
1 must lead it to a vertex wj0 0 ,i,i0 , which as we said cannot be part of any cycle.
Hence, no monochromatic cycle of color 1 exists. Consider then a monochromatic
cycle of color 2, which must begin from v2 . The next vertex on this cycle must be
0
a li,1 and since we have eliminated vertices wj,i 1 ,i2
the cycle must continue in the
directed path of clause i. But, since we started with a satisfying assignment, at
least one of the literal vertices of this path has color 1, meaning the cycle cannot
be monochromatic.
Finally, let us argue that if the digraph is 2-colorable, then φ is satisfiable.
Consider a 2-coloring which, without loss of generality, assigns 1 to v1 and 2 to v2 .
The coloring must give color 2 to all wi,j and color 1 to all wj,i1 ,i2 , because of the
digons connecting these vertices to the palette. Now, we obtain an assignment for
φ as follows: for each xj , we find the vertex in our graph that represents the literal
¬xj (this is unique since each variable appears exactly once negatively): we assign
xj to True if and only if this vertex has color 2. Let us argue that this assignment
satisfies all clauses. First, consider a clause with all negative literals. If this clause
is not satisfied, then all the vertices representing its literals have color 2. Because
vertices wi,j also all have color 2, this creates a monochromatic cycle with v2 ,
contradiction. Hence, all such clauses are satisfied. Second, consider a clause ci
with all positive literals. In the directed path representing ci at least one literal
vertex must have color 1, otherwise we would get a monochromatic cycle with v2 .
0
Suppose this vertex represents the literal xj and has an out-neighbor wj,i,i 2
, which
0
is colored 1. If the out-neighbor of wj,i1 ,i2 is also colored 1, we get a monochromatic
cycle with v1 . Therefore, that vertex, which represents the literal ¬xj has color 2.
But then, according to our assignment xj is True and ci is satisfied.
The last result of this section concerns 2-coloring of oriented graphs.
Theorem 3 It is N P -hard to decide if an oriented graph D = (V, E ) is 2-colorable
even when the size of its feedback vertex set is 3.
Digraph Coloring and Distance to Acyclicity 9
Proof We adapt the proof of Theorem 2. First let us give an intuition behind the
gadget we are going to use. In the proof of Theorem 2 the digraph we created is
not an oriented graph as it contains digons. All the digons of that digraph are
connected to vertices v1 or v2 , and therefore, we want to replace v1 and v2 with
a gadget that contains two arcs t1 t2 and f1 f2 such that the vertices t1 and t2 to
have the same color as v1 and the vertices f1 and f2 to have the same color as
v2 . Then we can replace all cycles that contained v1 (respectively, v2 ) with cycles
that contain the arc t1 t2 (respectively, f1 f2 ) and the rest of the proof will remain
the same.
The gadget we use in place of {v1 , v2 } is the one in the Fig. 2. Furthermore,
we will not use the digon between v1 and v2 and we replace all the other incoming
arcs of v1 from the previous construction with incoming arcs to t1 , the outgoing
arcs of v1 with outgoing arcs from t2 , the incoming arcs of v2 with incoming arcs
to f1 , the outgoing arcs of v2 with outgoing arcs from f2 . For example, the digon
v1 wi,1 in the gadget (α) from the previous theorem becomes a triangle t1 t2 wi,1 .
f1
v2 v1
t1 t2
v4 v3
f2
Fig. 2 Gadget H: It is 2-colorable, and in any 2-coloring both pairs {f1 , f2 } and {t1 , t2 } must
be monochromatic but with different color per pair.
Now we need to show that in any proper 2-coloring of this gadget both pairs
f1 , f2 and t1 , t2 are monochromatic and we use different color per pair.
First observe that there exists such a coloring (see Fig. 2) We will show that the
vertices f1 and t1 cannot have the same color. Assume that they are both colored
0; then the vertex f2 must be colored 1 because we have the cycle f1 , f2 , t1 . Because
the vertex f2 is colored 1 and there exists the cycle f2 , v3 , v4 we know that at least
one of v3 , v4 must be colored 0. Let v3 (respectively, v4 ) be colored 0, then the
coloring is not proper because there exists the cycle t1 , f1 , v3 (resp. t1 , f1 , v4 ) with
all the vertices colored 0. This is a contradiction so the f1 and t1 cannot have the
same color. Similarly we can prove that f2 and t1 cannot have the same color.
So we must color the vertices f1 and f2 with one color and t1 with the second.
Furthermore because we have the cycle f1 , f2 , t2 , the vertex t2 must use the same
color as t1 .
It remains to show that the size of minimum feedback vertex set is at most 3;
observe that the set {f1 , f2 , t1 } is a feedback vertex set (see Fig. 3).
10 A. Harutyunyan, M. Lampis, and N. Melissinos
v2 v1
t2
v4 v3
Fig. 3 For the remaining digraph, it has been proved that is acyclic in the previous theorem
so {f1 , f2 , t1 } is a feedback vertex set of the whole digraph.
This result is tight as, by Remark 2, we know that oriented graphs with DFVS
of size k are k-colorable.
In this section we first present two algorithmic results: we show that k-Digraph
Coloring becomes FPT (by k) if either the input graph has feedback vertex set
k and maximum degree at most 4k − 3; or if it has feedback arc set at most k2 − 1
(and unbounded degree). Interestingly, the latter of these results is exactly tight
and the former is almost tight: in the second part we refine the reduction of the
previous section to show that k-Digraph Coloring is NP-hard for digraphs which
have simlutaneously a FAS of size k2 , a feedback vertex set of size k and maximum
degree ∆ = 4k − 1.
Our first result shows that for k-Digraph Coloring, if we are promised a feedback
vertex set of size k (which is the smallest value for which the problem is non-trivial),
then the problem remains tractable for degree up to 4k− 3. Observe that in the case
of general digraphs (where we do not bound the feedback vertex set) the problem
is already hard for maximum degree 2k + 2 (see Other Related Work section),
so this seems encouraging. However, we show in Theorem 6 that this tractability
cannot be extended much further.
Before we continue let us define the following sets of vertices: we will call Vi,in
the set of vertices v ∈ N [F ] \ F such that c(v ) = i and there exists an arc vvi ∈ E .
Similarly we will call Vi,out the set of vertices v ∈ N [F ] \F where c(v ) = i and there
exists an arc vi v ∈ E . The sets Vi,in and Vi,out are disjoint in any proper coloring
(otherwise we would have a monochromatic digon). Furthermore, Vi,in ∪ Vi,out is
disjoint from Vj,in ∪ Vj,out for j 6= i (because their vertices have different colors),
so all these 2k sets are pair-wise disjoint. We first show that if one of these 2k sets
is empty, then we can color D.
Claim If for some i ∈ [k] one of the sets Vi,in , Vi,out is empty then we can extend
c to a k-coloring of D in polynomial time.
Proof We keep c unchanged and color all of V (D) \ N [F ] with color i. This is a
proper k-coloring. Indeed, this cannot create a monochromatic cycle with color
6 i. Furthermore, if a monochromatic cycle of color i exists, since this cycle
j =
must intersect F , we conclude that it must contain vi . However, in the current
k-coloring vi either has in-degree or out-degree 0 in the vertices colored i, so no
monochromatic cycle can go through it.
In the remainder we assume that all sets Vi,in , Vi,out are non-empty. Our strat-
egy will be to edit the k-coloring of D[N [F ]] so that we retain a proper k-coloring,
but one of these 2k sets becomes empty. We will then invoke Claim 4.1 to complete
the proof.
We now define, for each pair i, j ∈ [k] with i < j the set Ei,j which contains all
arcs with one endpoint in {vi , vj } and the other in Vi,in ∪ Vi,out ∪ Vj,in ∪ Vj,out and
whose endpoints have distinct colors. We call Ei,j the set of cross arcs for the pair
(i, j ). We will now argue that for some pair (i, j ) we must have |Ei,j | ≤ 3. For the
sake of contradiction, assume that |Ei,j | ≥ 4 for all pairs. Then, by summing up
the degrees of vertices of F we have:
X X k
d(vi ) ≥ 2k + k(2k − 2) + |Ei,j | ≥ 2k2 + 4 = 4 k 2 − 2k
2
i∈[k] i,j∈[k],i<j
In the first inequality we used the fact that each vi ∈ F has at least two
arcs connecting it to Vi,in ∪ Vi,out (since these sets are non-empty); 2k − 2 arcs
connecting it to other vertices of F (since F is a clique); and each cross arc of a
set Ei,j contributes one to the degree of one vertex of F . From this calculation we
infer that the average degree of F is at least 4k − 2, which is a contradiction, since
we assumed that the digraph has maximum degre 4k − 3.
Fix now i, j such that |Ei,j | ≤ 3. We will recolor Vi,in ∪ Vi,out ∪ Vj,in ∪ Vj,out in a
way that allows us to invoke Claim 4.1. Since we do not change any other color, we
will only need to prove that our recoloring does not create monochromatic cycles
of colors i or j in D[N [F ]]. We can assume that |Ei,j | = 3, since if |Ei,j | < 3 we can
add an arbitrary missing cross arc and this can only make the recoloring process
harder. Furthermore, without loss of generality, we assume that vi has strictly
more cross arcs of Ei,j incident to it than vj .
We now have to make a case analysis. First, suppose all three arcs of Ei,j are
incident on vi . Then, there exists a set among Vj,in , Vj,out that has at most one
arc connecting it to vi . We color this set i, and leave the other set colored j . We
12 A. Harutyunyan, M. Lampis, and N. Melissinos
also color Vi,in ∪ Vi,out with j . This creates no monochromatic cycle because: (i)
vi now has at most one neighbor colored i in Vi,in ∪ Vi,out ∪ Vj,in ∪ Vj,out , so no
monochromatic cycle goes through vi ; (ii) vj has either no out-neighbors or no
in-neighbors colored j in Vi,in ∪ Vi,out ∪ Vj,in ∪ Vj,out . With the new coloring we
can invoke Claim 4.1. In the remainder we therefore assume that two arcs of Ei,j
are incident on vi and one is incident on vj .
Second, suppose that one of Vj,in , Vj,out has no arcs connecting it to vi . We
color this set i and leave the other set colored j . Observe that one of Vi,in , Vi,out
has no arc connecting it to vj . We color that set j and leave the other set colored
i. In the new coloring both vi , vj either have no out-neighbor or no in-neighbor
with the same color in Vi,in ∪ Vi,out ∪ Vj,in ∪ Vj,out , so the coloring is proper and we
can invoke Claim 4.1. In the remainder we assume that vi has one arc connecting
it to each of Vj,in , Vj,out .
Third, suppose that both arcs of Ei,j incident on vi have the same direction
(into or out of vi ). We then color Vi,in ∪ Vi,out with j and Vj,in ∪ Vj,out with i. In
the new coloring vj has at most one neighbor with the same color and vi has either
only in-neighbors or only out-neighbors with color i, so the coloring is acyclic and
we again invoke Claim 4.1.
Finally, we have the case where two arcs of Ei,j are incident on vi , they have
different directions, one has its other endpoint in Vj,in and the other in Vj,out .
Observe that one of Vi,in , Vi,out has no arc connecting it to vj and suppose without
loss of generality that it is Vi,in (the other case is symmetric). We color Vi,in with
j and leave Vi,out with color i. One of Vj,in , Vj,out has an incoming arc from vi ; we
color this set i and leave the other colored j . Now, vi only has out-neighbors with
color i, while vj has at either only in-neighbors or only out-neighbors colored j , so
we are done in this final case.
Our second result concerns a parameter more restricted than feedback vertex
set, namely feedback arc set. Note that, in a sense, the class of graphs of bounded
feedback arc set contains the class of graphs that have bounded feedback vertex
set and bounded degree (selecting all incoming or outgoing arcs of each vertex
of a feedback vertex set produces a feedback arc set), so the following theorem
may seem more general. However, a closer look reveals that the following result is
incomparable to Theorem 4, because graphs of feedback vertex set k and maximum
degree 4k − 3 could have feedback arc set of size up to almost 2k2 (consider for
example a bi-direction of the complete graph Kk,2k−2 ), while the following theorem
is able to handle graphs of unbounded degree but feedback arc set up to (only)
k2 − 1. As we show in Theorem 6, this is tight.
4.2 Hardness
i
4. For each ` ∈ [M − 1], for all i, j ∈ [k] with i < j we have the arcs v`,out v`j+1,in ,
i
v`,out v`j+1,out , v`i+1,in v`,in
j j
, v`,out v`i+1,in . Again, arcs incident on an out and an
in vertex are oriented towards the in vertex.
vi vj FVS
row 1
i
v1,out i
v1,in j j
v1,in v1,out
Fig. 4 Graph showing the connections between two vertices of the clique palette (v i , v j , where
i < j) and the corresponding vertices of row 1.
j
i
v`,out i
v`,in j
v`,in v`,out row `
(for ` ≥ 1)
row ` + 1
i
v`+1,out i
v`+1,in j
v`+1,in j
v`+1,out
Fig. 5 Here we present the way we are connecting the vertices of the rows i and i + 1
Let P be the gadget we have constructed so far, consisting of the clique of size
k and the M rows of 2k vertices each. We will establish the following properties.
1. Deleting all vertices v i , i ∈ [k] makes P acyclic and eliminates all directed paths
i
from any vertex v`,in to any vertex v`j0 ,out , for all i, j ∈ [k], `, `0 ∈ [M ].
Digraph Coloring and Distance to Acyclicity 15
arcs. To see that this is a feedback arc set, suppose that the graph contains a
directed cycle after its removal. This cycle must contain some vertex v i , because
we argued that {v i | i ∈ [k]} is a feedback vertex set. Among these vertices, select
the v i with minimum i. We now examine the arc of the cycle going into v i . Its
tail cannot be v j for j > i, as we have removed such arcs, nor vj for j < i, as this
contradicts the minimality of i. It cannot be v1i ,in as we have also removed these
arcs. And it cannot be v1j ,in for j < i, as these arcs are also removed. But no other
in-neighbor of v i remains, contradiction.
Let us also argue that using the gadget P instead of the palette clique does not
affect the k-colorability of the graph. This is not hard to see because, following
Properties 3 and 4 we can assume that any k-coloring of P will give color i to all
vertices of {v i } ∪ {v`,in
i i
, v`,out | ` ∈ [M ]}. The important observation is now that,
for all ` ∈ [M ] there will always exist a monochromatic path from v i to v`,out i
and
i i
from v`,in to v . We now note that, if we fix a coloring of the non-palette part of
the graph, this coloring contains a monochromatic cycle involving vertex vi of the
original palette if and only if the same coloring gives a monochromatic cycle in
the new graph going through v i .
Finally, we need to prove the four properties.
Property 1. Once we delete {v i | i ∈ [k]} we observe that for every vertex v`,in i
its
j j
only outgoing arcs are to vertices v`,in for j < i or vertices v`−1,in for j ≥ i. This
i
shows that we have eliminated all directed paths from v`,in to v`j0 ,out . Furthermore,
i
this shows that no cycle can be formed using v`,in vertices, since all their outgoing
arcs either move to a previous row, or stay in the same row but decrease i. In a
16 A. Harutyunyan, M. Lampis, and N. Melissinos
i
similar way, no directed cycle can be formed using only v`,out vertices, as all their
outgoing arcs either move to a later row, or stay in the same row but decrease i.
Property 2. For a vertex v i we have 2k − 2 arcs incident on it from the clique; the
two arcs connecting it to v1i ,in , v1i ,out ; two arcs connecting it to v1j ,in , v1j ,out for j > i;
two arcs connecting it to v1j ,in for j < i. This gives 2k − 2 + 2i + 2(k − i) = 4k − 2.
For a vertex v1i ,in we have one arc to v j for j ≤ i; two arcs to v j for j > i; arcs to
j j
all vin , vout for j 6= i; arcs to v2j ,in for j ≤ i. This gives i+2(k−i)+2(k−1)+i = 4k−2.
For a vertex v1i ,out we have arcs from v j for j ≤ i; arcs to v1j ,in , v1j ,out for
j 6= i; arcs to v2j ,in and v2j ,out for j ≥ i; arcs to v2j ,in for all j < i. This gives
i + 2(k − 1) + 2(k − i) + i = 4k − 2.
i j j
For a vertex v`,in , ` ≥ 2 we have arcs to v`− 1,in
, for j ≥ i; to v`− 1,out
for j 6= i;
j j
to v`,in , v`,out for j 6= i; from v`j+1,in for j ≤ i. This gives (k − i + 1) + (k − 1) +
2(k − 2) + i = 4k − 2.
i j
Finally, for a vertex v`,out , ` ≥ 2 we have arcs from v`− 1,out
for j ≤ i; to
j j
v`,in , v`,out for j 6= i; to all v`j+1,in , for j 6= i; to v`j+1,out for j ≥ i. This gives
i + 2(k − 1) + (k − 1) + (k − i + 1) = 4k − 2.
Property 3. We assign color i to v i and to {v`,in i i
, v`,out | ` ∈ [M ]}. We claim that
there is no monochromatic cycle in P with this coloring. Indeed, if such a cycle
exists, it must use v i , as {v i | i ∈ [k]} is a feedback vertex set. But observe that
i
with the coloring we gave, for each ` ∈ [M − 1] the only out-neighbor of v`,out with
i i
color i is v`+1,out and vM,out has no out-neighbor of color i. Similar examination
i
of {v`,in | ` ∈ [M ]} shows that the part of P colored i induces a directed path on
2M + 1 vertices with v i in the middle.
Property 4. Since the vertices v i induce a clique, we may assume without loss of
generality that we are given a coloring c where c(v i ) = i. We prove the property
by induction on `. For ` = 1, we will first prove that c(v1i ,in ) = i by induction on i.
For the base case we have that v11,in is connected with a digon with v j for all j > 1,
so c(v11,in ) = 1. Now, fix a j and suppose that for all i < j we have c(v1i ,in ) = i.
Then v1j ,in cannot receive any color i < j , because this would make a cycle with
v1i ,in , v i . It can also not receive a color i > j because it has a digon to all v i for
i > j . Hence, c(v1j ,in ) = j . Continuing on ` = 1, we will prove by reverse induction
on i that c(v1i ,out ) = i. For c(v1k,out ) if we give this vertex any color j < k then we
get a cycle with v j , v1j ,in , so we must have c(v1k,out ) = k. Now fix an i and suppose
that for all j > i we have c(v1j ,out ) = j . If we give v1i ,out a color j > i this will make
a cycle with vj , v1j ,out , v1i ,out , v1j ,in . But if we give v1i ,out a smaller color j < i, this
will also make a cycle with v j , v1j ,in . Therefore, c(v1i ,out ) = i for all i.
Suppose now that the property is true for row ` and we want to prove it for
row ` + 1. We will use similar reasoning as in the previous case. We will also use
the observation that for all i, there is a monochromatic path from v i to v`,out i
i i
and a monochromatic path from v`,in to v . First, we show by induction on i
that c(v`i+1,in ) = i for all i. For v`1+1,in we observe that if we give this vertex
j j
color j > 1, then using the arcs from v`,out and to v`,in we have a monochro-
1
matic cycle of color j . Hence, c(v`+1,in ) = 1. Fix a j and suppose that for all
Digraph Coloring and Distance to Acyclicity 17
5 Treewidth
Proof The proof uses standard techniques so we sketch some details. In particular
we assume that we are given a nice tree decomposition on which we will perform
dynamic programming. Before we proceed, let us slightly recast the problem. We
will say that a digraph D = (V, E ) is k-colorable if there exist two functions c, σ
such that (i) c : V → [k] partitions V into k sets (ii) σ is an ordering of V (iii) for
all arcs uv ∈ E we have either c(u) 6= c(v ) or σ (u) < σ (v ). It is not hard to see
that this reformulation is equivalent to the original problem. Indeed, if we have a
k-coloring, since each color class is acyclic, we can find a topological ordering σi of
the graph G[Vi ] induced by each color class and then concatenate them to obtain
an ordering of V . For the converse direction, the existence of c, σ implies that if
we look at vertices of each color class, σ must induce a topological ordering, hence
each color class is acyclic.
Now, let D be a digraph and S be a subset of its vertices. Let (c, σ ) be a pair of
coloring and ordering functions that prove that D is k-colorable. Then, we will say
that the signature of solution (c, σ ) for set S is the pair (cS , σS ) where cS : S → [k]
is defined as cS (u) = c(u) and σS : S → [|S|] is an ordering function such that for
all u, v ∈ S we have σS (u) < σS (v ) if and only if σ (u) < σ (v ). In other words, the
signature of a solution is the restriction of the solution to the set S .
Given a rooted nice tree decomposition of D, let Bt be a bag of the decompo-
sition and denote by Bt↓ the set of vertices of D which are contained in Bt and
18 A. Harutyunyan, M. Lampis, and N. Melissinos
bags in the sub-tree rooted at Bt . Our dynamic programming algorithm stores for
each Bt a collection of all pairs (c, σ ) such that there exists a k-coloring of D[Bt↓ ]
whose signature is (c, σ ). If we manage to construct such a table for each node, it
will suffice to check if the collection of signatures of the root is empty to decide if
the graph is k-colorable.
The table is easy to initialize for Leaf nodes, as the only valid signature contains
the empty coloring and ordering function. For an Introduce node that adds u to
a bag containing Bt we consider all signatures (c, σ ) of contained in the table of
the child bag. For each such signature we construct a signature (c0 , σ 0 ) which is
consistent with (c, σ ) but also colors u and places it somewhere in the ordering
(we consider all such possibilities). For each (c0 , σ 0 ) we delete this signature if u
has a neighbor in the bag who is assigned the same color by c0 but such that their
arc violates the topological ordering σ 0 . We keep all other produced signatures.
To see that this is correct observe that u has no neighbors in Bt↓ \ Bt , because
all bags are separators, so if we produce an ordering of Bt↓ consistent with σ 0 the
only arcs incident on u that could violate it are contained in the bag (and have
been checked). For Forget nodes the table is easily update by keeping only the
restrictions of valid signatures to the new bag. Finally, for Join nodes we keep a
signature (c, σ ) if and only if it is valid for both sub-trees. Again this is correct
because nodes of one sub-tree not contained in the bag do not have neighbors in
the other sub-tree, so as long as we produce an ordering consistent with σ we can
concatenate we cannot violate the topological ordering condition.
For the running time observe that the size of the DP table is ktw (tw!), because
we consider all colorings and all ordering of each bag. In Introduce nodes we spend
polynomial time for each entry of the child node (checking all placements of the
new vertex), while computation in Join nodes can be performed in time linear in
the size of the table. So the running time is in the end ktw (tw!)nO(1) .
Proof Suppose we are given a 3-SAT formula φ with n variables and m clauses. We
will produce a digraph G such that |V (G)| = 2O(n/ log n) m and td(G) = O(n/ log n)
and G is 2-colorable if and only if φ is satisfiable. Before we proceed, observe that
if we can construct such a graph the theorem follows, as an algorithm with running
time O∗ (tdo(td) ) for 2-coloring G would decide the satisfiability of φ in time 2o(n) .
To simplify presentation we assume without loss of generality that n is a power
of 2 (otherwise adding dummy variables to φ can achieve this while increasing n be
a factor of at most 2). We begin the construction of G by creating log n independent
2en
sets V1 , . . . , Vlog n , each of size d log 2 n e. We add a vertex u and connect it with arcs
obtain the same color (as all are forced to have a distinct color from u), therefore
the way these vertices represent an assignment is via their topological ordering in
the DAG they induce together with other vertices of the graph which obtain the
same color.
To continue our construction, for each i ∈ [log n] we do the following: we
enumerate all the possible truth assignments of the variables of Xi and for each
such truth assignment σ : Xi → {0, 1}|Xi | we define (in an arbitrary way) a dis-
tinct ordering ρ(σ ) of the vertices of Vi . We will say that the ordering ρ(σ ) is the
2en
2en 2n
translation of assignment σ . Note that there are |Vi |! ≥ ( log 2 n )! ≥ ( log2 n )
log2 n =
2en n
(1+log n−2 log log n)
2 log2 n > 2d log n e for n sufficiently large, so it is possible to trans-
late truth assignments to Xi to orderings of Vi injectively. Note that enumerating
all assignments for each group takes time 2O(n/ log n) = 2o(n) .
Consider now a clause cj of φ and suppose some variable of the group Xi
appears in cj . For each truth assignment σ to Xi which satisfies cj we construct an
independent set Sj,i,σ of size |Xi | − 1, label its vertices s`j,i,σ , for ` ∈ [|Xi | − 1]. For
each ` we add an arc from ρ(σ )−1 (`) to s`j,i,σ and an arc from s`j,i,σ to ρ(σ )−1 (` +1).
In other words, the `-th vertex of Sj,i,σ has an incoming arc from the vertex of Vi
which is `-th according to the ordering ρ(σ ) which is the translation of assignment
σ and an outgoing arc to the vertex of Vi which is in position (` + 1) in the same
ordering. Observe that this implies that if all vertices of Vi and of Sj,i,σ are given
the same color, then the topological ordering of the induced DAG will agree with
ρ(σ ) on the vertices of Vi .
To complete the construction, for each clause cj we do the following: take all
independent sets Sj,i,σ which we have constructed for cj and order them in a cycle
in some arbitrary way. For two sets Sj,i,σ , Sj,i0 ,σ0 which are consecutive in this
cycle add a new “connector” vertex pj,i,σ,i0 ,σ0 , all arcs from Sj,i,σ to this vertex,
and all arcs from this vertex to Sj,i0 ,σ0 . Finally, we connect each connector vertex
pj,i,σ,i0 ,σ0 we have constructed to an arbitrary vertex of V1 with a digon. This
completes the construction.
Let us argue that if φ is satisfiable, then G is 2-colorable. We color u with color
2, all the vertices in Vi for i ∈ [log n] with 1 and all connector vertices pi,j,σ,i0 ,σ0 with
2. For each clause cj there exists a group Xi that contains a variable of cj such that
the supposed satisfying assignment of φ, when restricted to Xi gives an assignment
σ : Xi → {0, 1}|Xi | which satisfies cj . Therefore, there exists a corresponding set
Sj,i,σ . Color all vertices of this set with 1. After doing this for all clauses, we color
all other vertices with 2. We claim this is a valid 2-coloring. Indeed, the graph
induced by color 2 is acyclic, as it contains u (but none of its neighbors) and for
each cj , all but one of the sets Sj,i,σ and the vertices pj,i,σ,i0 ,σ0 . Since these sets
have been connected in a directed cycle throught connector vertices, and for each
cj we have colored one of these sets with 1, the remaining sets induce a DAG. For
the graph induced by color 1 consider for each Vi the ordering ρ(σ ), where σ is
the satisfying assignment restricted to Vi . Every vertex outside Vi which received
color 1 and has arcs to Vi , has exactly one incoming and one outgoing arc to Vi .
Furthermore, the directions of these arcs agree with the ordering ρ(σ ). Hence, since
∪i∈[log n] Vi touches all arcs with both endpoints having color 1 and all such arcs
respect the orderings of Vi , the graph induced by color 1 is acyclic.
For the converse direction, suppose we have a 2-coloring of G. Without loss of
generality, u has color 2 and ∪i∈[log n] Vi has color 1. Furthermore, all connectors
20 A. Harutyunyan, M. Lampis, and N. Melissinos
pj,i,σ,i0 ,σ0 also have color 2. Consider now a clause cj . We claim that there must
be a group Sj,i,σ such that Sj,i,σ does not use color 2. Indeed, if all such groups
use color 2, since they are linked in a directed cycle with all possible arcs between
consecutive groups and connectors, color 2 would not induce a DAG. So, for each
cj we find a group Sj,i,σ that is fully colored 1 and infer from this the truth
assignment σ for the group Xi . Doing this for all clauses gives us an assignment
that satisfies every clause. However, we need to argue that the assignment we
extract is consistent, that is, there do not exist Sj,i,σ and Sj 0 ,i,σ0 which are fully
colored 1 with σ 6= σ 0 . For the sake of contradiction, suppose that two such sets
exist, and recall that ρ(σ ) 6= ρ(σ 0 ). We now observe that if Sj,i,σ ∪ Vi only uses
color 1, then any topological ordering of Vi in the graph induced by color 1 must
agree with ρ(σ ), which is a total ordering of Vi . In a similar way, the ordering of
Vi must agree with ρ(σ 0 ), so if σ 6= σ 0 we get a contradiction.
Finally, let us argue about the parameters of G. For each clause cj of φ we
construct an independent set of size O(n/ log2 n) for each satisfying assignment of
a group Xi containing a variable of cj . There are at most 3 such groups, and each
group has at most 2n/ log n satisfying assignments for cj , so |V (G)| = 2O(n/ log n) m.
For the treedepth, recall that deleting a vertex decreases treedepth by at most
1. We delete u and all of ∪i∈[log n] Vi which are O(n/ log n) vertices in total. It now
suffices to prove that in the remainder all components have treedepth O(n/ log n).
In the remainder every component is made up of the directed cycle formed by
sets Sj,i,σ and connectors pj,i,σ,i0 ,σ0 . We first delete a vertex pj,i,σ,i0 ,σ0 to turn the
cycle into a directed “path” of length L = 2O(n/ log n) . We now use the standard
argument which proves that paths of length L have treedepth log L, namely, we
delete the pj,i,σ,i0 ,σ0 vertex that is closest to the middle of the path and then
recursively do the same in each component. This shows that the remaining graph
has treedepth logarithmic in the length of the path, therefore at most O(n/ log n).
6 2-Coloring Tournaments
Proof If the function cannot be extended the algorithm will return False because
in order to change the value to True that means that at one of the calls of the
algorithm we checked an extension C ∗ of C and it was a proper coloring for the
tournament which is a contradiction. So we have to prove that if the given function
C can be extended in order to give a proper coloring of the whole tournament then
the algorithm will return True. For the rest of the proof let us call the triangles
that contain one uncolored vertex and two vertices of the same color as type one
and the triangles with two uncolored vertices as type two. Let C be extendable
(i.e., there is an extension C ∗ that gives a proper coloring for the tournament);
22 A. Harutyunyan, M. Lampis, and N. Melissinos
the algorithm first checks if there exists a triangle of type one and gives to the
uncolored vertices the other color (in line 5). It is clear that this is the only option
for these vertices so that the new color function remains extendable. After that
the algorithm checks for triangles of type two. In this case we know that the two
uncolored vertices cannot have both the same color as the third vertex; so we have
a total of 22 − 1 = 3 cases. After that the algorithm checks (between lines 10
and 13) if any of these possibilities can be can be extended and gives us a proper
coloring (by calling itself in line 12).
As we mentioned, the algorithm tries to extend all the possible colorings (except
those that are not proper) so at some point we have an extendable function C and
either we do not have any uncolored vertices or we do not have any triangles of
type one or two.
Case 1. Suppose VN C = ∅ when line 16 of Algorithm 2 is executed. Then C is
a proper coloring of V which means that after the check in line 18 we change the
value of the variable Ext to True.
It remains to show that in the second case if we colored the remaining uncolored
vertices with any color we have a proper coloring for T .
Case 2. In this case we do not have any triangles of type one or two. This
combined with the assumption that the coloring is extendable implies that by
coloring the remaining vertices with any color we end up with a coloring that does
not have any monochromatic triangle. It remains to show the following claim:
Proof Assume that C does not give a proper coloring. Then there must exist a
monochromatic cycle S with length grater than 3. Note that S induces a tour-
nament. But any tournament which contains a directed cycle contains a triangle.
This gives a contradiction since there are no monochromatic triangles in T .
So our coloring is a proper 2-coloring; thus the algorithm will change the value
of the variable Ext to True in line 18 and due to the logic or in line 12 this True
will be kept until the algorithm terminates.
Proof It is easy to see that Algorithm 1 tries to extend any proper coloring of V1 .
Now, in order to use Lemma 2 we need to observe that we have no triangles in
V2 . Since a tournament without triangles is acyclic, it follows that V2 is acyclic.
So, from lemma 2 we know that if one of these colorings can be extended then the
Algorithm 2 will return True. Thus, Algorithm 1 returns True if the tournament
is 2-colorable and False otherwise.
Theorem 10 Let T = (V, E ) be√a tournament. Then we can decide if the dichromatic
number of T is two in time O∗ ( 3 6n )
Digraph Coloring and Distance to Acyclicity 23
Proof Observe that in Algorithm 1 all the steps are polynomial except the number
of the proper ways to color the set V1 and the time Algorithm 2 needs. Now, it
|V1 |
is easy to see that the number of proper ways to color V1 is at most 6 3 since
for every triangle in V1 we know that we have six possible choices to color it (all
except the two that give to every vertex the same color). This means that we
|V1 |
call Algorithm 2 at most 6 3 times. The running time of the second algorithm
depends on the number of times that it will call itself. Now we can see that for the
remaining vertices (V2 = V \V1 ), in the worst case, we need to check three different
colorings (see proof of lemma 2) for two vertices at a time. Thus, the running time
|V2 |
of Algorithm 2 is O∗ (3 2 ). So, we can decide if T is 2-colorable in time
|V1 | |V2 | √ √
O∗ (6 ) = O∗ ( 6|V1 |+|V2 | ) = O∗ ( 6n )
3 3
3 ·3 2
7 Conclusions
In this paper we have strengthened known results about the complexity of Di-
graph Coloring on digraphs which are close to being DAGs, precisely mapping
the threshold of tractability for DFVS and FAS; and we precisely bounded the
complexity of the problem parameterized by treewidth, uncovering an important
discrepancy with its undirected counterpart. One question for further study is to
settle the degree bound for which k-Digraph Coloring is NP-hard for DFVS k,
and more generally to map out how the tractability threshold for the degree evolves
for larger values of the DFVS from 4k − Θ(1) to 2k + Θ(1), which is the correct
threshold when the DFVS is unbounded. With regards to undirected structural
parameters, it would be interesting to investigate whether a vco(vc) algorithm ex-
ists for 2-Digraph Coloring, where vc is the input graph’s vertex cover, as it
seems challenging to extend our hardness result to this more restricted case.
References
1. Pierre Aboulker, Nathann Cohen, Frédéric Havet, William Lochet, Phablo F. S. Moura,
and Stéphan Thomassé. Subdivisions in digraphs of large out-degree or large dichromatic
number. Electron. J. Comb., 26(3):P3.19, 2019.
2. Stephan Dominique Andres and Winfried Hochstättler. Perfect digraphs. Journal of
Graph Theory, 79(1):21–29, 2015.
3. Julien Baste, Ignasi Sau, and Dimitrios M. Thilikos. A complexity dichotomy for hit-
ting connected minors on bounded treewidth graphs: the chair and the banner draw the
boundary. In Shuchi Chawla, editor, Proceedings of the 2020 ACM-SIAM Symposium on
Discrete Algorithms, SODA 2020, Salt Lake City, UT, USA, January 5-8, 2020, pages
951–970. SIAM, 2020.
4. Julien Bensmail, Ararat Harutyunyan, and Ngoc-Khang Le. List coloring digraphs. Jour-
nal of Graph Theory, 87(4):492–508, 2018.
5. Benjamin Bergougnoux, Édouard Bonnet, Nick Brettell, and O-joung Kwon. Close rel-
atives of feedback vertex set without single-exponential algorithms parameterized by
treewidth. CoRR, abs/2007.14179, 2020.
6. Dietmar Berwanger, Anuj Dawar, Paul Hunter, Stephan Kreutzer, and Jan Obdrzálek.
The dag-width of directed graphs. J. Comb. Theory, Ser. B, 102(4):900–923, 2012.
7. Drago Bokal, Gasper Fijavz, Martin Juvan, P. Mark Kayll, and Bojan Mohar. The circular
chromatic number of a digraph. Journal of Graph Theory, 46(3):227–240, 2004.
24 A. Harutyunyan, M. Lampis, and N. Melissinos
8. Marthe Bonamy, Lukasz Kowalik, Jesper Nederlof, Michal Pilipczuk, Arkadiusz Socala,
and Marcin Wrochna. On directed feedback vertex set parameterized by treewidth. In
Andreas Brandstädt, Ekkehard Köhler, and Klaus Meer, editors, Graph-Theoretic Con-
cepts in Computer Science - 44th International Workshop, WG 2018, Cottbus, Germany,
June 27-29, 2018, Proceedings, volume 11159 of Lecture Notes in Computer Science, pages
65–78. Springer, 2018.
9. Édouard Bonnet, Nick Brettell, O-joung Kwon, and Dániel Marx. Generalized feed-
back vertex set problems on bounded-treewidth graphs: Chordality is the key to single-
exponential parameterized algorithms. Algorithmica, 81(10):3890–3935, 2019.
10. Jianer Chen, Yang Liu, Songjian Lu, Barry O’Sullivan, and Igor Razgon. A fixed-parameter
algorithm for the directed feedback vertex set problem. J. ACM, 55(5):21:1–21:19, 2008.
11. Xujin Chen, Xiaodong Hu, and Wenan Zang. A min-max theorem on tournaments. SIAM
J. Comput., 37(3):923–937, 2007.
12. Marek Cygan, Fedor V. Fomin, Lukasz Kowalik, Daniel Lokshtanov, Dániel Marx, Marcin
Pilipczuk, Michal Pilipczuk, and Saket Saurabh. Parameterized Algorithms. Springer,
2015.
13. Marek Cygan, Jesper Nederlof, Marcin Pilipczuk, Michal Pilipczuk, Johan M. M. van
Rooij, and Jakub Onufry Wojtaszczyk. Solving connectivity problems parameterized by
treewidth in single exponential time. In Rafail Ostrovsky, editor, IEEE 52nd Annual
Symposium on Foundations of Computer Science, FOCS 2011, Palm Springs, CA, USA,
October 22-25, 2011, pages 150–159. IEEE Computer Society, 2011.
14. Tomás Feder, Pavol Hell, and Carlos S. Subi. Complexity of acyclic colorings of graphs
and digraphs with degree and girth constraints. CoRR, abs/1907.00061, 2019.
15. Henning Fernau and Daniel Meister. Digraphs of bounded elimination width. Discret.
Appl. Math., 168:78–87, 2014.
16. Fedor V. Fomin, Petr A. Golovach, Daniel Lokshtanov, and Saket Saurabh. Intractability
of clique-width parameterizations. SIAM J. Comput., 39(5):1941–1956, 2010.
17. Fedor V. Fomin, Petr A. Golovach, Daniel Lokshtanov, Saket Saurabh, and Meirav Zehavi.
Clique-width III: hamiltonian cycle and the odd case of graph coloring. ACM Trans.
Algorithms, 15(1):9:1–9:27, 2019.
18. Jakub Gajarský, Michael Lampis, and Sebastian Ordyniak. Parameterized algorithms
for modular-width. In IPEC, volume 8246 of Lecture Notes in Computer Science, pages
163–176. Springer, 2013.
19. Robert Ganian, Petr Hlinený, Joachim Kneis, Daniel Meister, Jan Obdrzálek, Peter Ross-
manith, and Somnath Sikdar. Are there any good digraph width measures? J. Comb.
Theory, Ser. B, 116:250–286, 2016.
20. Frank Gurski, Dominique Komander, and Carolin Rehs. Acyclic coloring of special di-
graphs. CoRR, abs/2006.13911, 2020.
21. Ararat Harutyunyan. Brooks-type results for coloring of digraphs. PhD Thesis, Simon
Fraser University, 2011.
22. Ararat Harutyunyan, Mark Kayll, Bojan Mohar, and Liam Rafferty. Uniquely d-colorable
digraphs with large girth. Canad. J. Math., 64(6):1310–1328, 2012.
23. Ararat Harutyunyan, Tien-Nam Le, Stéphan Thomassé, and Hehui Wu. Coloring tourna-
ments: From local to global. J. Comb. Theory, Ser. B, 138:166–171, 2019.
24. Winfried Hochstättler, Felix Schröder, and Raphael Steiner. On the complexity of digraph
colourings and vertex arboricity. Discret. Math. Theor. Comput. Sci., 22(1), 2020.
25. Paul Hunter and Stephan Kreutzer. Digraph measures: Kelly decompositions, games, and
orderings. Theor. Comput. Sci., 399(3):206–219, 2008.
26. Russell Impagliazzo, Ramamohan Paturi, and Francis Zane. Which problems have strongly
exponential complexity? J. Comput. Syst. Sci., 63(4):512–530, 2001.
27. Lars Jaffke and Bart M. P. Jansen. Fine-grained parameterized complexity analysis of
graph coloring problems. In CIAC, volume 10236 of Lecture Notes in Computer Science,
pages 345–356, 2017.
28. Thor Johnson, Neil Robertson, Paul D. Seymour, and Robin Thomas. Directed tree-width.
J. Comb. Theory, Ser. B, 82(1):138–154, 2001.
29. Michael Lampis. Algorithmic meta-theorems for restrictions of treewidth. Algorithmica,
64(1):19–37, 2012.
30. Michael Lampis. Finer tight bounds for coloring on clique-width. In ICALP, volume 107
of LIPIcs, pages 86:1–86:14. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2018.
31. Michael Lampis, Georgia Kaouri, and Valia Mitsou. On the algorithmic effectiveness of
digraph decompositions and complexity measures. Discret. Optim., 8(1):129–138, 2011.
Digraph Coloring and Distance to Acyclicity 25
32. Zhentao Li and Bojan Mohar. Planar digraphs of digirth four are 2-colorable. SIAM J.
Discret. Math., 31(3):2201–2205, 2017.
33. Daniel Lokshtanov, Dániel Marx, and Saket Saurabh. Known algorithms on graphs of
bounded treewidth are probably optimal. ACM Trans. Algorithms, 14(2):13:1–13:30, 2018.
34. Marcelo Garlet Millani, Raphael Steiner, and Sebastian Wiederrecht. Colouring non-even
digraphs. CoRR, abs/1903.02872, 2019.
35. Bojan Mohar. Circular colorings of edge-weighted graphs. Journal of Graph Theory,
43(2):107–116, 2003.
36. Bojan Mohar. Eigenvalues and colorings of digraphs. Linear Algebra and its Applications,
432(9):2273 – 2277, 2010. Special Issue devoted to Selected Papers presented at the Work-
shop on Spectral Graph Theory with Applications on Computer Science, Combinatorial
Optimization and Chemistry (Rio de Janeiro, 2008).
37. Victor Neumann-Lara. The dichromatic number of a digraph. J. Comb. Theory, Ser. B,
33(3):265–270, 1982.
38. Raphael Steiner and Sebastian Wiederrecht. Parameterized algorithms for directed mod-
ular width. In CALDAM, volume 12016 of Lecture Notes in Computer Science, pages
415–426. Springer, 2020.