The Parameterized Complexity of Coloring Mixed Graphs
Abstract
A mixed graph contains (undirected) edges as well as (directed) arcs, thus generalizing undirected and directed graphs. A proper coloring of a mixed graph assigns a positive integer to each vertex such that for every edge and for every arc of . As in classical coloring, the objective is to minimize the number of colors. Thus, mixed (graph) coloring generalizes classical coloring of undirected graphs and allows for more general applications, such as scheduling with precedence constraints, modeling metabolic pathways, and process management in operating systems; see a survey by Sotskov [Mathematics, 2020].
We initiate the systematic study of the parameterized complexity of mixed coloring. We focus on structural graph parameters that lie between cliquewidth and vertex cover, primarily with respect to the underlying undirected graph. Unlike classical coloring, which is fixed-parameter tractable () parameterized by treewidth or neighborhood diversity, we show that mixed coloring is -hard for treewidth and even paraNP-hard for neighborhood diversity. To utilize the directedness of arcs, we introduce and analyze natural generalizations of neighborhood diversity and cliquewidth to mixed graphs, and show that mixed coloring becomes when parameterized by (the generalized) mixed neighborhood diversity. Further, we investigate how these parameters are affected if we add transitive arcs, which do not affect colorings. Finally, we provide tight bounds on the chromatic number of mixed graphs, generalizing known bounds on mixed interval graphs.
Keywords and phrases:
Mixed Graphs, Coloring, Parameterized Complexity, Structural Graph ParametersCopyright and License:
2012 ACM Subject Classification:
Theory of computation Parameterized complexity and exact algorithms ; Mathematics of computing Graph coloringAcknowledgements:
This work was started at the workshop Homonolo 2024 in Nová Louka. We thank the organizers and the other participants.Editor:
Pierre FraigniaudSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
The problem of coloring graphs, i.e., assigning as few colors as possible to vertices of an undirected graph such that adjacent vertices receive distinct colors, is an old and extensively studied problem in graph theory with applications in various areas, such as scheduling, frequency assignment, and graph drawing [24]. An example of a scheduling problem that can be modeled using graph coloring is timetabling, where courses (vertices) need to be scheduled in certain time slots (colors) while respecting conflicts (edges), e.g., due to two courses having the same teacher or students. These types of problems are referred to as chromatic scheduling problems. In real world applications, there are usually several additional constraints, such as certain courses having to be scheduled in specific time slots, certain teachers not being available at certain times, courses using multiple consecutive time slots, or a lecture having to be held before the corresponding exercises. Thus, there exist several extensions of coloring to accommodate these additional constraints, such as using list coloring to restrict courses to certain slots [9], or using interval coloring to enforce consecutive time slots [23]. To account for precedence constraints, for example, if a course has to be scheduled before another, Hansen et al. [20] added arcs to the graph, with the idea that the arc expresses that has to be scheduled before . This leads to the notion of a mixed graph , which consists of a set of vertices, a set of (undirected) edges, and a set of (directed) arcs. A mixed graph combines the concepts of undirected and directed graphs. We require mixed graphs to be simple, i.e., without loops and without parallel edges or arcs.
A -coloring of a mixed graph is proper if it holds for every edge that and it holds for every arc that . We call the problem of deciding whether a mixed graph can be properly colored with colors -MixedColoring. As a mixed graph cannot be properly colored if it contains a directed cycle, we consider only mixed graphs without directed cycles. Apart from scheduling, mixed graph colorings have also been applied in graph drawing in order to compact layered orthogonal drawings [19]. See the survey by Sotskov [32] for more details and applications of mixed graph colorings.
Since MixedColoring generalizes the classical Coloring problem for undirected graphs, it is also -hard for three or more colors. As such, it is natural to study its parameterized complexity. However, to our knowledge, there has not yet been a systematic study of the parameterized complexity of MixedColoring. The only known results in this direction are an -algorithm parameterized by the number of edges (i.e., not counting arcs) by Hansen et al. [20], with subsequent improvements by Damaschke [8], as well as an -algorithm parameterized by treewidth by Ries and de Werra [30].
Meanwhile, the parameterized complexity of Coloring has been extensively studied. On the positive side, results include the well-known dynamic program that runs in time, where is the number of colors, is the treewidth of the graph, and the -notation hides polynomial factors. Since treewidth bounds the chromatic number of undirected graphs, this implies that Coloring is parameterized by treewidth. Lokshtanov et al. [27] even showed that under SETH (a hypothesis about the complexity of SAT with at most literals per clause) there is no -time algorithm for any , i.e., the algorithm is probably optimal. Further results include Coloring being parameterized by neighborhood diversity, as shown by Ganian [15]. On the negative side, Fomin et al. [13] showed that Coloring is -hard parameterized by cliquewidth. However, Coloring still admits an -algorithm parameterized by cliquewidth, as shown by Kobler and Rotics [22]. Further, applying Courcelle’s theorem [4, 5], a famous meta-theorem that yields -algorithms, it follows that Coloring is parameterized by cliquewidth plus chromatic number.
Understanding the relationships between various structural graph parameters is crucial for analyzing the parameterized complexity of a problem. We say that a graph parameter (upper) bounds another parameter if there exists a computable function such that for every (mixed) graph , it holds that . If no such function exists, we say that does not (upper) bound . If (upper) bounds and does not (upper) bound , we say that strictly (upper) bounds . Meanwhile, if neither parameter bounds the other, we say that they are incomparable. Conversely, if two parameters bound each other, we say that they are equivalent. For example, since treewidth is bounded by vertex cover, this implies that any problem that is parameterized by treewidth, such as Coloring, is also parameterized by vertex cover.
For mixed graphs however, it is not immediately clear how to apply the existing parameters, as they are defined for undirected graphs. The approach taken in previous works is to consider the parameters w.r.t. the underlying undirected graph, i.e., the graph obtained by replacing all arcs with edges. The downside of this approach is that it neglects the directedness of arcs. In fact, Courcelle and Olariu [6] originally defined cliquewidth for undirected as well as for directed graphs, yielding a natural generalization for mixed graphs. Further, Fernau et al. [11] generalized neighborhood diversity to directed graphs by distinguishing between incoming and outgoing neighbors; this can also be generalized to mixed graphs.
| Parameter | Complexity | Reference |
| Theorem 18 | ||
| Theorem 28 | ||
| Theorem 31 | ||
| Cor. 20 | ||
| -hard | Theorem 23 | |
| paraNP-hard | Theorem 24 | |
| paraNP-hard | Theorem 25 |
Contribution.
In order to better explore the parameterized complexity of MixedColoring, we first introduce and analyze the generalizations of neighborhood diversity and cliquewidth to mixed graphs, which we call mixed neighborhood diversity () and mixed cliquewidth (), respectively. Since in MixedColoring we can assume that the input graph does not contain directed cycles, we only analyze these parameters for mixed graphs without directed cycles. We explore their relationships with existing parameters defined on the underlying undirected graph, such as vertex cover (), treedepth (), pathwidth (), feedback vertex set (), treewidth (), as well as neighborhood diversity () and cliquewidth (); see the full version [26] for detailed definitions. Specifically, we show that strictly bounds (Proposition 1) and is strictly bounded by (Proposition 2). Similarly, we show that strictly bounds (Proposition 5) and is strictly bounded by (Proposition 6). Furthermore, we show that strictly bounds (Proposition 7), while and are incomparable (Proposition 8).
Since arcs enforce precedence constraints on the colors of the vertices, transitive arcs, i.e., arcs between vertices connected by a directed path along other arcs, do not influence the properness of colorings of mixed graphs. Adding all transitive arcs (and removing any edges parallel to transitive arcs) results in the transitive closure of a mixed graph (without directed cycles). We denote with the transitive closure counterpart of the parameter , i.e., . We show that , , , , and are strictly bounded by their transitive closure counterparts (Proposition 9), while for and the situation is inverted, with and strictly bounding and , respectively (Proposition 12). Meanwhile, and are incomparable to their transitive closure counterparts (Proposition 13). The resulting hierarchy of parameters is visualized in Figure 1.
Furthermore, we also consider bounds for the chromatic number () of mixed graphs, i.e., the minimum number of colors needed for a proper coloring. After providing some simple lower bounds, i.e., that the chromatic number of a mixed graph is lower-bounded by the chromatic number of the underlying undirected graph as well as by maxrank (), the length of the longest directed path, we generalize and tighten a bound by Gutowski et al. [18] on the chromatic number of mixed interval graphs (Theorem 15). Based on this, we show that the chromatic number of a mixed graph is bounded by as well as and (Corollary 17).
Coloring Directed Graphs.
For directed graphs, Neumann-Lara [28] introduced the dichromatic number and the corresponding coloring, where each color class induces an acyclic subgraph. This problem, known as DigraphColoring [21], also generalizes coloring undirected graphs, as each edge can be replaced by two opposite arcs. Therefore, DigraphColoring is -hard. In contrast, MixedColoring is easy on directed graphs: if the graph is acyclic, greedily coloring vertices in topological order yields an optimal coloring. Otherwise, the graph cannot be properly colored. This difference arises due to the fact that DigraphColoring treats arcs very differently: in MixedColoring, there cannot be arcs between vertices of the same color, whereas in DigraphColoring there can be arcs between vertices of the same color, as long as these arcs do not form a directed cycle.
On directed acyclic graphs, MixedColoring, especially when considering the transitive closure, behaves somewhat similar to OrientedColoring [31], where, between each pair of color classes, all arcs must have the same orientation. However, contrary to MixedColoring, OrientedColoring does not forbid directed cycles.
Conventions.
For positive integer , we use as shorthand for . We say that a mixed graph is a partial orientation of its underlying undirected graph. The full versions of proofs marked with a (clickable) star () can be found in the full version of this paper [26].
2 Mixed Graph Parameters
We define the mixed cliquewidth of a mixed graph , denoted by , to be the minimum number of distinct labels needed to construct using the following operations:
-
creation of a new vertex with label , denoted by .
-
disjoint union of two labeled mixed graphs, denoted by .
-
adding an (undirected) edge between every vertex with label and every vertex with label , for , denoted by .
-
adding a (directed) arc from every vertex with label to every vertex with label , for , denoted by .
-
renaming label to label , denoted by .
These are exactly the operations used by Courcelle and Olariu [6] in their definitions of cliquewidth for undirected and directed graphs. Instead of using only for undirected graphs and only for directed graphs, we allow both operations to be used in order to construct mixed graphs, thereby generalizing the concept of cliquewidth to mixed graphs. We call the sequence of such operations constructing a given mixed graph using labels a mixed -expression. For example, the directed path of length is constructed by the mixed -expression . As it turns out, mixed cliquewidth is not bounded by cliquewidth.
Proposition 1.
For any mixed graph (without directed cycles), . Furthermore, does not bound .
Proof.
The first part follows directly from the definitions, as replacing all arc operations by edge operations in a mixed -expression constructing yields an -expression constructing the underlying undirected graph of .
Let be the subgraph of resulting from omitting all edges. It holds that , as by omitting the edge operations in a mixed -expression constructing we obtain a mixed -expression for . Using this, we construct a family of mixed graphs with and . We construct by orienting an -grid graph such that no directed cycles are created. As shown by Golumbic and Rotics [17], the cliquewidth of an -grid graph is and thus . Furthermore, between any pair of vertices of that are not connected by an arc, we add an edge. This results in the underlying undirected graph of being a complete graph, which has cliquewidth , and thus .
Courcelle and Olariu [6] showed that the cliquewidth of undirected as well as of directed graphs is bounded by treewidth. We can utilize their result for directed graphs to show that mixed cliquewidth (on mixed graphs without directed cycles) is also bounded by treewidth. To this end, we transform a mixed graph without directed cycles into its corresponding directed graph by replacing each edge by two opposite arcs and . Since mixed graphs without directed cycles cannot contain opposite arcs (as they would form a directed cycle of length two) this transformation is injective. We define the directed cliquewidth of a mixed graph without directed cycles, denoted , to be the (directed) cliquewidth of the corresponding directed graph . As we show now, mixed and directed cliquewidth are, while not equal, equivalent under the lens of parameterized complexity.
Idea.
Converting a mixed -expression for into a directed -expression for is straightforward, as we can replace each edge operation by two opposite arc operations. The inverse requires a careful manipulation of the -expression for , to ensure that we can replace pairs of opposite arc operations by edge operations.
The partial orientation of the star , where the center vertex is connected to one leaf by an edge and to the other leaf by an outgoing arc, has and .
In order to generalize neighborhood diversity to mixed graphs without directed cycles, we first need to define the different types of neighbors that occur in a mixed graph. Given a vertex of a mixed graph , the outgoing neighbors of , denoted by , are all vertices to which has an outgoing arc . Analogously, the incoming neighbors of , denoted by , are all vertices from which has an incoming arc . The undirected neighbors of , denoted by , are all vertices which are connected to by an edge . Thus, the neighborhood of a vertex , denoted by , is the union of its incoming, outgoing, and undirected neighbors.
The parameter neighborhood diversity is defined for undirected graphs via an equivalence relation on the vertices, where two vertices are of the same type, denoted , if they have the same neighbors, i.e., if . We generalize this equivalence relation to mixed graphs by further distinguishing between incoming, outgoing, and undirected neighbors. Therefore, two vertices of a mixed graph are of the same (mixed) type, denoted , if they have the same in-, out-, and undirected neighbors, i.e., if , , and .
Lemma 3 ().
For any mixed graph (without directed cycles), the relation is an equivalence relation. Further, vertices of the same type induce an (undirected) clique or an independent set.
We call the partition of the vertices into equivalence classes under a mixed neighborhood partition. The mixed neighborhood diversity of a mixed graph , denoted , is the number of equivalence classes under . Note that this generalizes the definition of neighborhood diversity for undirected graphs. Furthermore, for mixed graphs without directed cycles, this is also a generalization of the definition of neighborhood diversity for directed graphs by Fernau et al. [11], as in directed graphs without directed cycles there are no opposite arcs. Note further that a mixed neighborhood partition can be obtained easily: it suffices to check, for each pair of vertices, whether they are of the same type.
As is the case for mixed cliquewidth and cliquewidth, the mixed neighborhood diversity can differ arbitrarily from the neighborhood diversity of the underlying undirected graph since each vertex in a directed path has to be of a different type, as we show now.
Lemma 4.
Given a mixed graph (without directed cycles) that contains a directed path of length , it holds that , with each vertex on the path being of a different type.
Proof.
We know from Lemma 3 that there cannot be an arc between two vertices of the same type. Let be a directed path of length in . Suppose that there are two vertices with that are of the same type. Since , it follows that . However, as , it follows that there exists a directed path from to in . Together with the arc , this yields a directed cycle, a contradiction to containing no directed cycles.
Proposition 5.
For any mixed graph (without directed cycles), . Furthermore, does not bound .
Proof.
It follows directly from the definitions that two vertices of the same type w.r.t. must also be of the same type w.r.t. . Indeed, if , it holds that
(as there cannot be any arc between and ) and therefore .
The inverse does not hold, as two vertices of the same type w.r.t. may differ in their in- or out-neighbors, as the following family of graphs shows. The graph is a partial orientation of the complete graph obtained by orienting edges such that the resulting mixed graph contains a directed Hamiltonian path. It holds that but, due to Lemma 4, .
Lampis [25] showed that neighborhood diversity is bounded by vertex cover, as the type of vertices not contained in the cover is determined uniquely by their neighbors (in the cover), resulting in a bound of . Since mixed neighborhood diversity further distinguishes between in-, out-, and undirected neighbors, we obtain the following bound.
Proposition 6.
For any mixed graph (without directed cycles), .
Proof.
Let be a vertex cover of of size . Since each vertex in only contains neighbors in , there are at most different types of vertices in , as each vertex in can be an in-, out-, or undirected neighbor, or not a neighbor at all. Further, there can be at most different types of vertices in , as contains vertices. Thus, the total number of types is bounded by .
If a parameter does not bound () on undirected graphs (or vice versa), it also does not bound () (or vice versa), as it holds that () on undirected graphs. Lampis [25] showed that bounds and that (and therefore ) does not bound ( is even incomparable to ). It follows from this that does not bound . Using a proof analogous to Lampis, we further obtain the following.
Regarding the relationship between and , we already know that does not bound (due to not bounding ). However, while bounds , it does not bound . We show this by reusing the construction that we used to show that does not bound (Proposition 1), as detailed in the following.
Transitive Closure.
Recall that an arc is transitive if there exists a directed path from to using other arcs. The transitive closure of a mixed graph is the mixed graph obtained by adding every transitive arc to (and removing any resulting parallel edges). As transitively closed graphs are a subset of mixed graphs, all bounds between parameters on mixed graphs also apply between their transitive closure counterparts. Further, if a parameter does not bound a parameter on undirected graphs, then does not bound , as it holds that and on undirected graphs. Thus, it remains to analyze the relationship between the parameters and their transitive closure counterparts.
All parameters considered in this paper, except for neighborhood diversity and cliquewidth, have the well-known property that they bound their value on any subgraph. Since the underlying graph of the transitive closure of a mixed graph is a subgraph of the underlying graph of the original graph, it follows that these parameters are bounded by their transitive closure counterparts.
Idea.
The second part can be shown using a family of oriented stars, where half of the edges are oriented towards the center vertex and the other half are oriented away from the center vertex.
However, for neighborhood diversity and cliquewidth (and their mixed variants), the situation is different. Contrary to the other parameters, these parameters are not bounded by their transitive closure counterparts, as shown in the following.
Proposition 10.
The parameters , , , and are not bounded by their transitive closure counterparts.
Proof.
We first construct a family of grid graphs where but . The graph is a partial orientation of the -grid graph where edges are oriented such that contains a directed Hamiltonian path, i.e., a directed path of length containing all vertices. Golumbic and Rotics [17] showed that the cliquewidth of -grid graphs is . Together with Proposition 1 we obtain that . As contains a directed Hamiltonian path, it follows that is the acylic tournament graph, the directed graph with exactly one arc between each pair of vertices (and without directed cycles). Using the following claim, we obtain that .
For neighborhood diversity, we construct a separate family based on tripartite graphs. The graph consists of three independent sets , , and . We add arcs and for , such that every has an outgoing arc to every and every has an outgoing arc to every . To ensure that vertices of different sets are of different types, we further add three vertices , , and . We then add edges , , and for all . Lastly, we add arcs for . Thus, each vertex has a distinct type, as does every vertex . Meanwhile, all vertices are of the same type. Further, the vertices , , and have distinct types. This results in . However, in the transitive closure, each vertex has an outgoing arc to every vertex and therefore all are of the same type and all are of the same type, resulting in .
In fact, both mixed neighborhood diversity and mixed cliquewidth bound their transitive closure counterparts, as shown in the following.
Idea.
For mixed neighborhood diversity, it holds that two vertices of the same type in are also of the same type in , as the set of vertices to (from) which have outgoing (incoming) paths in are equivalent.
For mixed cliquewidth, we show that given a mixed -expression constructing , we can obtain a -expression constructing . The idea is to keep track of the labels of vertices to which a given vertex has outgoing paths and the labels of vertices from which it has incoming paths. This can be achieved by using additional labels for each original label. These additional labels then allow us to add the transitive arcs, resulting in the claimed bound.
The same does not hold for neighborhood diversity and cliquewidth, as these are in fact incomparable to their transitive closure counterparts, as the following shows.
Proposition 13.
The parameters and are incomparable to their transitive closure counterparts.
Proof.
We already know from Proposition 10 that these parameters are not bounded by their transitive closure counterparts. Thus, it remains to show that they do not bound their transitive closure counterparts. For this, we construct a family of graphs such that while .
The graph consists of grid vertices and arc vertices and is constructed such that the grid vertices form an independent set in but induce an -grid in . This is achieved through the usage of the arc vertices, which connect two grid vertices adjacent in with a directed path, thus ensuring that the transitive arc is present in . Further, each arc vertex is connected to all grid vertices via edges, except for those to which it is connected via an arc. This ensures that all arc vertices are of the same type and that all grid vertices are of the same type, resulting in ; see Figure 2 for an example of the construction for . As shown by Golumbic and Roctis [17], the cliquewidth of an -grid is . Furthermore, it is easy to see that the cliquewidth of a graph bounds the cliquewidth of induced subgraphs. Thus, it follows that .
Chromatic Number.
Clearly, any proper coloring of a mixed graph is also a proper coloring of the underlying undirected graph and thus the chromatic number of the underlying undirected graph lower bounds the chromatic number of the mixed graph. Recall that the maxrank of a mixed graph is the length of the longest directed path in the graph. For a given vertex , we define the inrank, denoted as , as the length of the longest directed path ending in . Furthermore, as vertices along a directed path must be colored increasingly, every vertex has a color that is at least its inrank. Thus, it holds that the chromatic number bounds the maxrank. We summarize these insights in the following proposition.
Proposition 14.
For any mixed graph (without directed cycles), and .
For undirected graphs, several (upper) bounds on the chromatic number are known, such as treewidth and maximum degree. However, these bounds do not generalize to mixed graphs, as a simple directed path of length has treewidth and maximum degree , but chromatic number . Gutowski et al. [18, Theorem 9 & Proposition 10] showed that for mixed interval graphs it holds that , where is the clique number, and that this bound is asymptotically tight. They achieved this by introducing the concept of layering, which is a partition of the vertex set into layers such that the layer contains all vertices of inrank . In a layering, each arc is oriented towards the higher layer, as it must hold for every arc that . It follows that each subgraph induced by a layer is an undirected graph. Thus, we can iteratively color each layer with disjoint color sets, resulting in a proper coloring of the entire graph as formalized in the following theorem.
Theorem 15 ().
For any mixed graph (without directed cycles) and its corresponding layering , it holds that . Further, this bound is tight.
Regarding the transitive closure, note that and , as adding transitive arcs neither changes the length of the longest directed path nor the validity of a coloring. Thus, we obtain the following bounds on maxrank.
As the chromatic number of a subgraph is a lower bound for the chromatic number of the entire graph, it follows from Theorem 15 and Proposition 16 that any parameter that bounds the chromatic number of undirected graphs as well as the maxrank also bounds the chromatic number of mixed graphs.
Corollary 17 ().
The chromatic number of mixed graphs is bounded by as well as and . In fact, it even holds for every mixed graph that .
The resulting hierarchy is visualized in Figure 1.
3 Parameterized Complexity of MixedColoring
Recall that a problem is fixed-parameter tractable () with respect to a parameter if it can be solved in time, where is a computable function and is the size of the input. A problem is slice-wise polynomial () with respect to if it can be solved in time (where and are as above). Clearly, . Note that, given an - or -algorithm for -(Mixed)Coloring that is parameterized by the number of colors, , we can easily obtain an - or -algorithm parameterized by the chromatic number. Therefore, we state our results with respect to the parameter chromatic number (if the runtime is or parameterized by the number of colors).
Courcelle’s theorem yields for any problem that can be expressed in monadic second-order logic on graphs an -algorithm parameterized by tree- or even cliquewidth (depending on the logic variant used). Like cliquewidth, monadic second-order logic on graphs extends intuitively to mixed graphs, and expressing MixedColoring as a monadic second-order formula is straightforward. However, to our knowledge, Courcelle’s theorem has not yet been entirely proven for mixed graphs, with Arnborg et al. [1] only proving the theorem for treewidth but not for cliquewidth. Still, by converting our mixed graphs into directed graphs as in Proposition 2, we can apply the directed version of Courcelle’s theorem to obtain the following result.
Theorem 18 ().
The problem MixedColoring is parameterized by mixed cliquewidth plus chromatic number.
While Courcelle’s theorem yields an -algorithm for MixedColoring, the resulting algorithm is quite impractical. For example, the runtime contains huge constants depending on the length of the formula, i.e., the number of colors, which cannot be bounded by an elementary function unless , as shown by Frick and Grohe [14]. Since polynomials are elementary functions, this also implies that this algorithm is not an -algorithm parameterized solely by tree- or cliquewidth.
Another Coloring algorithm can also be generalized to MixedColoring: it is well known [7, Theorem 7.9] that Coloring, given a tree-decomposition of width , can be solved in time via a dynamic program. By exchanging the checks for a proper coloring with checks for a proper mixed coloring (i.e., additionally checking that no arc is violated), MixedColoring can be solved within the same time bound, as we now summarize.
Theorem 19.
Given a mixed graph and a tree-decomposition of width , the problem -MixedColoring can be solved in time.
As an optimal tree-decomposition can be computed in -time w.r.t. treewidth [2] and the chromatic number is bounded by the number of vertices, this yields and algorithms for MixedColoring, as summarized in the following.
Corollary 20.
MixedColoring is parameterized by treewidth plus chromatic number and parameterized solely by treewidth.
Note that this algorithm is an improvement over the -algorithm developed by Ries and de Werra [30], which runs in time, where is the number of edges and the number of vertices.
We cannot hope for an -algorithm parameterized by treewidth alone, as we show in the following that MixedColoring is -hard w.r.t. pathwidth and feedback vertex set, which are parameters that bound treewidth. We achieve this via a parameterized reduction from ListColoring, a generalization of Coloring where each vertex can only be assigned a color from a given list. While Fellows et al. [10] only showed that ListColoring is -hard w.r.t. treewidth, their reduction actually even yields -hardness w.r.t. vertex cover, as we show in the following lemma.
To reduce ListColoring to -MixedColoring, where is the total number of distinct colors in the ListColoring instance, we enforce the color list of each vertex by adding adequate edges to newly inserted directed paths of vertex-length . This yields the following.
Lemma 22 ().
There exists a parameterized reduction w.r.t. pathwidth as well as w.r.t. feedback vertex set from ListColoring to MixedColoring.
Combining the -hardness of ListColoring with the parameterized reduction to MixedColoring we obtain the following theorem.
Theorem 23.
MixedColoring is -hard w.r.t. feedback vertex set as well as w.r.t. pathwidth.
Recall that Coloring is with respect to neighborhood diversity [15] and with respect to cliquewidth [22]. In contrast to that, we now show that MixedColoring is paraNP-hard with respect to both of these parameters, even in more restricted settings.
Idea.
Given a set of strings over the binary alphabet and a positive integer , the problem ShortestSuperstring asks whether there is a string of length at most that is a superstring of each string in . ShortestSuperstring is -hard [29].
We reduce from ShortestSuperstring by constructing a mixed graph such that a proper -coloring of corresponds to a length- superstring of . We achieve this by creating a directed path for each string in such that the vertices of the path correspond to the characters of the string; we add edges such that vertices corresponding to different characters cannot receive the same color. See Figure 3(a) for an example. Thus, the color of a vertex corresponds to the position of the corresponding character in the superstring, and the directions of the paths enforce that the characters of each string appear in the correct order.
To ensure a constant maxrank, we then split each directed path at every vertex into two vertices, with one vertex obtaining the incoming and the other the outgoing arc. We then connect each new pair of vertices to a distinct -clique, thus enforcing that the two vertices receive the same color in any proper -coloring; see Figure 3(b). Therefore, regarding proper -colorings, they can be treated as a single vertex, while the maxrank of the resulting graph is , due to all directed paths having been split. Furthermore, the resulting graph has a mixed cliquewidth of at most .
Theorem 25.
MixedColoring is paraNP-hard parameterized by neighborhood diversity, even if considering the neighborhood diversity of the transitive closure.
Proof.
We reduce from the following problem, which is -hard [16, SS9].
| Problem: | PrecedenceConstrainedScheduling |
|---|---|
| Input: | Sets of unit-length tasks, a partial order on , an integer . |
| Question: | Can the tasks be scheduled with makespan on two parallel machines and such that the tasks in are assigned to , the tasks in are assigned to , and all precedence constraints are respected (i.e., if , then must finish before starts)? |
Given an instance of PrecedenceConstrainedScheduling, we create a -MixedColoring instance such that each block of four consecutive colors corresponds to one time unit on the machines.
First, we create a directed path consisting of vertices , which we will use to ensure that each task is scheduled on its assigned machine. Note that in any proper -coloring, the path has the same unique coloring, with each vertex receiving the color . For each task , we create two task vertices, the start vertex and the end vertex , connected via the arc . We denote with the set of integers that are congruent to modulo . For each start vertex of a task in , we add an edge to each vertex of the path with . As a result, receives a color in in every proper -coloring of . Analogously, we add edges between each end vertex of a task in and each vertex of the path with to ensure that receives a color in . For tasks in , we similarly add edges to ensure that the start vertices receive colors in and the end vertices receive colors in . The precedence constraints are enforced by adding arcs between the corresponding tasks, i.e., for each with we add the arc . Lastly, it remains to ensure that no two tasks are scheduled at the same time on the same machine. We achieve this by adding (undirected) edges such that the underlying undirected graph induced by the task vertices forms a clique. An example of the resulting graph is shown in Figure 4.
Claim 26 ().
The resulting graph has a proper -coloring if and only if there is a schedule of the tasks on their assigned machines that respects the precedence constraints and finishes by time .
As these claims show, the resulting MixedColoring instance is equivalent to the original PrecedenceConstrainedScheduling instance, with the neighborhood diversity of the transitive closure being . Thus, MixedColoring is paraNP-hard w.r.t. neighborhood diversity, even when considering the neighborhood diversity of the transitive closure.
The picture changes if we parameterize by mixed neighborhood diversity.
Theorem 28.
MixedColoring is parameterized by mixed neighborhood diversity.
Proof.
Let be a mixed graph. We can assume w.l.o.g. that each type of induces a clique, as all vertices of a type inducing an independent set can be merged into a single vertex. This is due to the fact that they have the same neighborhoods and therefore can be assigned the same color. Let be the set of types of , where each is a clique in . In the following, we write and to express that there is an undirected edge or a directed arc, respectively, between the types and in . For a coloring of and a set , let . If is proper, then, for every , all colors in are smaller than all colors in . We define a type-endpoint preorder as a function that assigns, to each type , two integers (with and ), which we call the type endpoints of . We say that a coloring corresponds to a type-endpoint preorder if there is a sequence of ascending (not necessarily consecutive) colors such that, for each type , the set is contained in the halfopen interval . We say that a (type-endpoint) preorder is proper if, for each arc , it holds that . An example of a proper preorder and a corresponding coloring is shown in Figure 5.
Claim 29 ().
Given a proper (type-endpoint) preorder , any coloring that corresponds to does not violate any arcs. Further, any proper coloring corresponds to at least one proper preorder.
In total, there are type endpoints and thus at most orders of these endpoints. Since type endpoints can be equal, there are at most (proper) preorders. Therefore, we can enumerate all proper preorders in -time w.r.t. mixed neighborhood diversity. We can thus check whether is -colorable by checking, for each proper preorder , whether there exists a proper -coloring of that corresponds to . Since we know that such a coloring does not violate any arcs, it suffices to check whether it does not violate any edges. This problem has similarities to Coloring, differing in that we additionally require the colors within each type to adhere to the given preorder. For Coloring, Ganian [15] provided an -algorithm w.r.t. neighborhood diversity based on an ILP. In the following, we adapt his ILP to additionally respect a given proper preorder .
Since we only need to decide whether there exists a -coloring of that corresponds to the given proper preorder , we do not need an objective function. For an overview of the ILP, see the full version [26]. We have two kinds of variables. First, for every , we introduce an integer variable to obtain a sequence of colors. We enforce that these colors form an ascending sequence (by adding, for each , the constraint ). Second, for each and each subset , we introduce an integer variable , which represents the number of colors in the interval that are shared exclusively by the types in . Formally, we want that , where is the set of colors assigned to the vertices of type by the coloring ; see Figure 5 for an example. For each , we need to ensure that the ILP does not assign too many colors in the interval . We achieve this by adding the constraint . Moreover, we want the coloring to correspond to the given preorder . To achieve this, for each type , we first ensure that no color is assigned to (by adding the constraint ). Second, we ensure that enough colors are assigned to in the interval formed by its two type endpoints (by adding the constraint ). Third, we ensure that no color is assigned to (by adding the constraint ). It remains to ensure that no two types connected by an edge share a color. To this end, for each and each set that contains types and with , we add the constraint .
Claim 30 ().
For a given proper preorder , there is a feasible solution to the constructed ILP if and only if there is a proper -coloring of that corresponds to .
It is well known [12, Theorem 9.19] that an ILP can be solved in -time w.r.t. the number of variables. Hence, we can solve the ILP in -time w.r.t. mixed neighborhood diversity as it uses variables. Therefore, by enumerating all proper preorders and checking for each preorder whether a corresponding proper -coloring exists, we can decide in -time w.r.t. mixed neighborhood diversity whether is -colorable.
Furthermore, while MixedColoring is paraNP-hard w.r.t. neighborhood diversity, it becomes if we use the chromatic number as an additional parameter.
Theorem 31.
MixedColoring is parameterized by neighborhood diversity plus chromatic number.
Proof.
It was shown by Christofides [3] that there exists an optimal coloring of an (undirected) graph where one color class forms a maximal independent set. However, this property does not hold for mixed graphs; see Figure 6. Fortunately, we can strengthen the property by only considering maximal independent sets of vertices with inrank , i.e., vertices without incoming arcs, resulting in the following formula for the chromatic number.
Claim 32 ().
For every (non-empty) mixed graph there exists an optimal coloring of where the first color class forms a maximal independent set in the subgraph induced by the vertices of inrank . Thus, for every mixed graph it holds that if is empty and otherwise, where the minimum is taken over all maximal independent sets in the subgraph induced by the vertices of inrank .
Furthermore, we can bound the number of maximal independent sets in the subgraph induced by vertices of inrank by neighborhood diversity and clique number, as the following shows.
Claim 33 ().
For every (non-empty) mixed graph it holds that the number of maximal independent sets in the subgraph induced by the vertices of inrank is at most .
We implement the recursive formula for the chromatic number as a branching algorithm for MixedColoring as follows: Given a mixed graph and a number of colors , we branch on all maximal independent sets in the subgraph induced by the vertices of inrank and recursively check whether is -colorable until we either reach the empty graph or run out of colors. Thus, the recursion depth is bounded by . As in each step we branch into at most subproblems, this results in an overall runtime of , which is w.r.t. neighborhood diversity plus chromatic number, as .
4 Open Problems
While we defined mixed neighborhood diversity and mixed cliquewidth only for mixed graphs without directed cycles, these parameters can also be defined for mixed graphs with directed cycles. For mixed cliquewidth the definition remains the same, while for mixed neighborhood diversity the definition can be adapted by integrating the restrictions for opposite arcs introduced by Fernau et al. [11]. The relationships of these more general parameters should be analogous; most proofs can be generalized directly since they do not depend on the requirement that mixed graphs do not contain directed cycles. We remark that it seems likely that Courcelle’s theorem extends to (general) mixed cliquewidth, which would facilitate its application to other problems on mixed graphs. Further, we think that it would be interesting to investigate how graph parameters and problem complexities change if we remove all transitive arcs from input graphs. Preliminary computational experiments indicate that MixedColoring algorithms benefit from such a data reduction step. Lastly, while we explored the parameterized complexity of MixedColoring, exact (non-parameterized) algorithms for MixedColoring remain largely unexplored (except for ILP-based approaches).
References
- [1] Stefan Arnborg, Jens Lagergren, and Detlef Seese. Easy problems for tree-decomposable graphs. J. Algorithms, 12(2):308–340, 1991. doi:10.1016/0196-6774(91)90006-K.
- [2] Hans L. Bodlaender. A linear-time algorithm for finding tree-decompositions of small treewidth. SIAM J. Comput., 25(6):1305–1317, 1996. doi:10.1137/S0097539793251219.
- [3] Nicos Christofides. An algorithm for the chromatic number of a graph. Comput. J., 14(1):38–39, 1971. doi:10.1093/COMJNL/14.1.38.
- [4] Bruno Courcelle. The monadic second-order logic of graphs. I. Recognizable sets of finite graphs. Inf. Comput., 85(1):12–75, 1990. doi:10.1016/0890-5401(90)90043-H.
- [5] Bruno Courcelle and Joost Engelfriet. Graph Structure and Monadic Second-Order Logic – A Language-Theoretic Approach, volume 138 of Encyclopedia of Mathematics and Its Applications. Cambridge University Press, 2012. doi:10.1017/cbo9780511977619.
- [6] Bruno Courcelle and Stephan Olariu. Upper bounds to the clique width of graphs. Discret. Appl. Math., 101(1–3):77–114, 2000. doi:10.1016/S0166-218X(99)00184-5.
- [7] Marek Cygan, Fedor V. Fomin, Łukasz Kowalik, Daniel Lokshtanov, Dániel Marx, Marcin Pilipczuk, Michał Pilipczuk, and Saket Saurabh. Parameterized Algorithms. Springer, 2015. doi:10.1007/978-3-319-21275-3.
- [8] Peter Damaschke. Parameterized mixed graph coloring. J. Comb. Optim., 38(2):362–374, 2019. doi:10.1007/S10878-019-00388-Z.
- [9] Dominique de Werra. Restricted coloring models for timetabling. Discrete Math., 165-166:161–170, 1997. doi:10.1016/S0012-365X(96)00208-7.
- [10] Michael R. Fellows, Fedor V. Fomin, Daniel Lokshtanov, Frances A. Rosamond, Saket Saurabh, Stefan Szeider, and Carsten Thomassen. On the complexity of some colorful problems parameterized by treewidth. Inf. Comput., 209(2):143–153, 2011. doi:10.1016/J.IC.2010.11.026.
- [11] Henning Fernau, Florent Foucaud, Kevin Mann, Utkarsh Padariya, and Rajath Rao K. N. Parameterizing path partitions. Theor. Comput. Sci., 1028:115029, 2025. doi:10.1016/J.TCS.2024.115029.
- [12] Jörg Flum and Martin Grohe. Parameterized Complexity Theory. Texts in Theoretical Computer Science. An EATCS Series. Springer, 2006. doi:10.1007/3-540-29953-X.
- [13] Fedor V. Fomin, Petr A. Golovach, Daniel Lokshtanov, and Saket Saurabh. Intractability of clique-width parameterizations. SIAM J. Comput., 39(5):1941–1956, 2010. doi:10.1137/080742270.
- [14] Markus Frick and Martin Grohe. The complexity of first-order and monadic second-order logic revisited. Ann. Pure Appl. Log., 130(1-3):3–31, 2004. doi:10.1016/J.APAL.2004.01.007.
- [15] Robert Ganian. Using neighborhood diversity to solve hard problems. ArXiv report, 2012. arXiv:1201.3091.
- [16] Michael R. Garey and David S. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman, 1979.
- [17] Martin Charles Golumbic and Udi Rotics. On the clique-width of some perfect graph classes. Int. J. Foundat. Comput. Sci., 11(3):423–443. doi:10.1142/S0129054100000260.
- [18] Grzegorz Gutowski, Konstanty Junosza-Szaniawski, Felix Klesen, Paweł Rzążewski, Alexander Wolff, and Johannes Zink. Coloring and recognizing mixed interval graphs. In Satoru Iwata and Naonori Kakimura, editors, 34th International Symposium on Algorithms and Computation (ISAAC), volume 283 of LIPIcs, pages 36:1–36:14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2023. doi:10.4230/LIPIcs.ISAAC.2023.36.
- [19] Grzegorz Gutowski, Florian Mittelstädt, Ignaz Rutter, Joachim Spoerhase, Alexander Wolff, and Johannes Zink. Coloring mixed and directional interval graphs. In Patrizio Angelini and Reinhard von Hanxleden, editors, 30th International Symposium on Graph Drawing and Network Visualization (GD), volume 13764 of LNCS, pages 418–431. Springer, 2022. doi:10.1007/978-3-031-22203-0_30.
- [20] Pierre Hansen, Julio Kuplinsky, and Dominique de Werra. Mixed graph colorings. Math. Methods Oper. Res., 45(1):145–160, 1997. doi:10.1007/BF01194253.
- [21] Ararat Harutyunyan, Michael Lampis, and Nikolaos Melissinos. Digraph Coloring and Distance to Acyclicity. Theory Comput. Syst., 68(4):986–1013, 2024. doi:10.1007/s00224-022-10103-x.
- [22] Daniel Kobler and Udi Rotics. Edge dominating set and colorings on graphs with fixed clique-width. Discrete Appl. Math., 126(2–3):197–221, 2003. doi:10.1016/S0166-218X(02)00198-1.
- [23] Marek Kubale. Interval vertex-coloring of a graph with forbidden colors. Discrete Math., 74(1–2):125–136, 1989. doi:10.1016/0012-365X(89)90204-5.
- [24] Marek Kubale, editor. Graph Colorings, volume 352 of Contemporary Mathematics. AMS, Providence, RI, 2004. doi:10.1090/conm/352.
- [25] Michael Lampis. Algorithmic meta-theorems for restrictions of treewidth. Algorithmica, 64(1):19–37. doi:10.1007/s00453-011-9554-x.
- [26] Antonio Lauerbach, Konstanty Junosza-Szaniawski, Marie Diana Sieper, and Alexander Wolff. The parameterized complexity of coloring mixed graphs. ArXiv report, 2026. arXiv:2604.15274.
- [27] 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. doi:10.1145/3170442.
- [28] Víctor Neumann-Lara. The dichromatic number of a digraph. J. Combin. Theory Ser. B, 33(3):265–270, 1982. doi:10.1016/0095-8956(82)90046-6.
- [29] Kari-Jouko Räihä and Esko Ukkonen. The shortest common supersequence problem over binary alphabet is NP-complete. Theor. Comput. Sci., 16:187–198, 1981. doi:10.1016/0304-3975(81)90075-X.
- [30] Bernard Ries and Dominique de Werra. On two coloring problems in mixed graphs. Eur. J. Comb., 29(3):712–725, 2008. doi:10.1016/J.EJC.2007.03.006.
- [31] Éric Sopena. Homomorphisms and colourings of oriented graphs: An updated survey. Discrete Math., 339(7):1993–2005, 2016. doi:10.1016/j.disc.2015.03.018.
- [32] Yuri N. Sotskov. Mixed graph colorings: A historical review. Math., 8(3):385:1–24, 2020. doi:10.3390/math8030385.
