Structural Parameters for Steiner Orientation
Abstract
We consider the Steiner Orientation problem, where we are given as input a mixed graph and a set of demand pairs , . The goal is to orient the undirected edges of in a way that the resulting directed graph has a directed path from to for all . We adopt the point of view of structural parameterized complexity and investigate the complexity of Steiner Orientation for standard measures, such as treewidth. Our results indicate that Steiner Orientation is a surprisingly hard problem from this point of view. In particular, our main contributions are the following:
-
1.
We show that Steiner Orientation is NP-complete on instances where the underlying graph has feedback vertex number 2, treewidth 2, pathwidth 3, and vertex integrity 6.
-
2.
We present an XP algorithm parameterized by vertex cover number vc of complexity . Furthermore, we show that this running time is essentially optimal by proving that a running time of would refute the ETH.
-
3.
We consider parameterizations by the number of undirected or directed edges ( or ) and we observe that the trivial -time algorithm for the former parameter is optimal under the SETH. Complementing this, we show that the problem admits a -time algorithm.
In addition to the above, we consider the complexity of Steiner Orientation parameterized by (FPT), distance to clique (FPT), and (FPT with a polynomial kernel).
Keywords and phrases:
ETH, Steiner Orientation, TreewidthFunding:
Tesshu Hanaka: Partially supported by JSPS KAKENHI Grant Numbers JP21K17707, JP22H00513, JP23H04388, JP25K03077, and JST, CRONOS, Japan Grant Number JPMJCS24K2.Copyright and License:
Manolis Vasilakis; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Parameterized complexity and exact algorithmsEditors:
Ho-Lin Chen, Wing-Kai Hon, and Meng-Tsung TsaiSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
The Steiner Orientation problem is an NP-hard graph optimization problem, which involves assigning directions to the undirected edges of a mixed graph – a graph containing both directed and undirected edges – to satisfy specific connectivity requirements, given by pairs of terminals. The objective is to orient the undirected edges in such a way that there exists a directed path between each given terminal pair. Formally, the problem is defined as follows.
The Steiner Orientation problem has been well-studied in bioinformatics, motivated by modeling protein–protein or protein–DNA interactions [16, 19, 9, 18]. Another motivation naturally arises from designing transportation networks. For example, in an urban transportation network with a mix of one-way streets (directed arcs) and two-way streets (undirected edges), one can consider the traffic control problem of deciding the direction of some streets to ensure routes from specific origins to destinations. This scenario is naturally modeled as the Steiner Orientation problem.
Regarding its complexity, Arkin and Hassin show that Steiner Orientation is NP-complete in general, but polynomially solvable if [1]. From the perspective of parameterized complexity, Cygan et al. [7] proposed an -time algorithm for the number of terminal pairs as a parameter, which shows that the problem belongs to the class XP. However, subsequent research has revealed the problem’s intractability for this parameterization; Steiner Orientation is shown to be W[1]-hard when parameterized by and cannot be solved in time under ETH [17]. This lower bound was later improved to a ETH-based lower bound even on planar graphs [4]. Surprisingly, Włodarczyk recently proved that the problem is not just W[1]-hard, but W[1]-complete [20]. This series of studies has almost completely characterized the complexity with respect to the parameter . Despite this literature, to the best of our knowledge, the parameterized complexity of Steiner Orientation is only studied for the number of terminal pairs. The complexity with respect to graph parameters such as treewidth or vertex cover number has been almost entirely unstudied. This paper aims to provide the first systematic study in this direction.
1.1 Our Contribution
In this paper, we first show the para-NP-completeness of Steiner Orientation for the parameters pathwidth, feedback vertex number, and vertex integrity.111In this paper, graph parameters refer to those of the underlying graph of , that is, the graph obtained by replacing all arcs with undirected edges. We assume that the reader is familiar with standard parameters, but recall some of the relevant definitions and relations further below. Specifically, the problem is NP-complete on series-parallel graphs (i.e., graphs of treewidth at most 2) of vertex-deletion distance 2 to a forest of stars of size at most 4. By slightly modifying our reduction, we further obtain NP-hardness for grid graphs (which are planar and have maximum degree ) with bounded pathwidth. Notice that, in a sense, these results clearly delineate the frontier of polynomial-time versus NP-complete cases for most standard graph parameters: On the one hand, when we place no bound on the degree, Steiner Orientation is already NP-hard on graphs which are 2 vertices away from an extremely restricted class. On the other hand, for bounded-degree graphs no such result can be obtained, as any graph that has bounded tree-depth and bounded degree actually has bounded size, so the hardness for bounded pathwidth graphs is essentially best possible.
The results above motivate us to consider more restrictive parameters. In this direction, we present an XP algorithm parameterized by vertex cover number, vc, that runs in time . Even though this improves the situation compared to the paraNP-completeness for treewidth, this complexity is rather disappointing, raising the natural question whether the square in the exponent is necessary. Our main contribution for this parameter is to answer this question by proving that an time algorithm would refute the ETH. Along the way, we also show that Steiner Orientation is fixed-parameter tractable when parameterized by distance to a clique, which can be seen as the dense analogue of vertex cover (a vertex cover of a graph is a clique modulator of its complement).
Moving in another direction, we consider the number of undirected or directed edges as parameters. Here, we show that Steiner Orientation is fixed-parameter tractable (FPT) when parameterized by the number of directed edges. We observe that if , the problem is solvable in polynomial time as a consequence of Robbins’ theorem [14]. Thus, our result generalizes this classical polynomial-time case. Here, it is natural to consider the number of undirected edges. Since we have only two directions for each undirected edge, Steiner Orientation is clearly solvable in time. Indeed, this running time is essentially tight, as a careful observation of the standard NP-hardness reduction for Steiner Orientation [1] yields a lower bound under the SETH.
Finally, we investigate the parameterized complexity with respect to the combined parameters and . We show that Steiner Orientation is FPT when parameterized by by formulating it as an MSO2 problem, which stands in contrast to the NP-hardness on series-parallel graphs. Furthermore, we give a polynomial kernel when parameterized by .
Overview of Techniques.
Our NP-completeness proof for Steiner Orientation on graphs of treewidth is based on a direct reduction from a variant of 3-SAT, where we naturally use undirected edges to represent variables of the initial formula, with directions representing truth assignments (this is standard). The key new insight is the following: we can transmit information between copies of such edges, ensuring they must be oriented in a consistent way, by adding demand pairs which must be routed through two main hub vertices. By using appropriately oriented arcs to connect our gadgets to the two hubs we ensure that gadgets don’t interfere with each other. In a sense, the take-home message of this construction is that the structure of alone is not enough to measure the complexity of an instance, because the way that demand pairs interact with the graph can significantly complicate the structure of the instance.
The XP algorithm parameterized by vertex cover is based on a simple branching procedure: for each pair of vertices of the vertex cover, guess if there is a directed path of length at most from to in the solution and, if yes, which is (potentially) the vertex in the middle of the path. This clearly leads to at most guesses, and once we have fixed these decisions it is not hard to complete the solution because we can infer exactly which vertices of the cover have directed paths to each other.
Given the simplicity of the algorithm sketched above for vertex cover, it is somewhat surprising that this is essentially optimal (under the ETH). We establish this by giving a reduction from -Clique producing a Steiner Orientation instance with vertex cover . The key intuition is again that we can use a small number () of hubs, through which information will be routed. In particular, we set up a complete bipartite graph and for each edge of this graph we set up a gadget encoding a selection in the original instance: the number of edges of this graph is sufficient to encode all selections, but the vertex cover of the construction is determined by the number of vertices of the complete bipartite graph.
To obtain an algorithm for parameter we face significantly more obstacles than for parameter (which is trivially FPT). Our approach relies on exhaustive applications of some (standard) reduction rules for this problem, which eliminate all cycles and degree vertices. We then focus on a restricted special case of Steiner Orientation, where all undirected components are paths, all internal vertices of the paths are incident on no arcs, and the endpoints of each path are incident on at most one arc. We solve this restricted case using a reduction to 2-SAT. We then show, using arguments which essentially take into account that is a feedback edge set of the underlying graph, that a simple branching algorithm can reduce any instance into instances of the (polynomial-time solvable) restricted case.
The FPT algorithm for distance to clique relies again on exhaustively applying reduction rules that eliminate cycles and then making some simple structural observations: there are few edges incident on the modulator vertices (so we can guess their orientation); and the edges contained in the clique must have a very simple structure (they form a matching). The FPT algorithm for relies on a formulation of the problem in MSO2 logic and Courcelle’s theorem – we leave it as an interesting open problem to determine the best dependence for this parameterization. Finally, for the more restrictive parameter we obtain a polynomial kernel via a maximum matching argument. In particular, we show that by calculating a maximum matching between pairs of vertices of the vertex cover and non-terminals in the indpendent set, we can identify a set of vertices of the independent set which are sufficient to obtain a solution and delete the rest, giving a kernel of order .
1.2 Related work
The Steiner Orientation problem has been studied extensively. From a bioinformatics perspective, an optimization version of Steiner Orientation is widely studied [16, 19, 9, 18]. In this optimization version, called Maximum Steiner Orientation, the goal is to find an orientation that maximizes the number of satisfied terminals pairs.
Unfortunately, Maximum Steiner Orientation is significantly more difficult than Steiner Orientation. Medvedovsky et al. [16] show that the problem is inapproximable within a factor of 12/13 even on undirected stars and binary trees. Elberfeld et al. then observe that the NP-hardness reduction for Steiner Orientation in [1] implies the inapproximability within a factor of 7/8 [10]. More recently, Hörsch [15] considered the maximization version of Steiner Orientation but under the restriction that the set of demand pairs includes all possible demands and showed that this case is also APX-hard. Interestingly, for this version of the problem Hörsch supplies an XP algorithm for parameter and leaves it as an open question whether an FPT algorithm can be obtained. In this paper we provide an FPT algorithm for Steiner Orientation parameterized by , but this is somewhat orthogonal to Hörsch’s question, as we are not dealing with the maximization version (which makes our problem easier) but we are also not assuming that all pairs of vertices have a demand (which makes our problem harder).
For the approximability, an -approximation is presented for undirected graphs [16]. This has been improved to a factor [11], and later to [7]. For bounded feedback vertex number graphs and bounded treewidth graphs, an -approximation algorithm and an -approximation algorithm are presented [10].
From the viewpoint of parameterized complexity, Dorn et al. [9] and Roayaei [18] propose several FPT algorithms for parameters related to terminal pairs.
Regarding the parameterized approximation, Chitnis, Feldmann, and Suchý [4] show that there is no constant such that Maximum Steiner Orientation on planar graphs admits an -approximation222Note that in [4] the approximation ratio is defined as the value of the approximate solution divided by the value of the optimal solution, which results in ratios smaller than . In most other works, the ratio is instead defined as the optimal solution divided by the approximate solution, which gives values larger than . in time . Włodarczyk [20] shows that there is no -approximation algorithm for Maximum Steiner Orientation that runs in FPT time with respect to assuming FPT W[1].
2 Preliminaries
We use the standard notations in graph theory. Let be a mixed graph where is a set of vertices, is a set of undirected edges, and is a set of directed edges. We denote by an undirected edge between and and by a directed edge from to .
A mixed graph is a mixed acyclic graph if it has no cycle. Notice that in the context of mixed graphs a cycle is any sequence of vertices with such that between any two consecutive vertices the graph contains either the edge or the arc . By definition, the subgraph induced by undirected edges in a mixed acyclic graph is a forest. Moreover, the graph obtained from a mixed acyclic graph by contracting all the undirected edges is a directed acyclic graph. For a vertex subset , we denote by the subgraph induced by , where and . A mixed path of a mixed graph is a path using both edges and arcs respecting the orientation of the arcs. For a mixed graph , denotes an orientation of and denotes the directed graph obtained by the orientation .
Graph parameters.
Throughout the paper we will use several structural graph parameters which will in general refer to the underlying graph of a given mixed graph . Recall that the underlying graph is the graph obtained by replacing each arc by an edge with the same endpoints. The parameters we will mention are treewidth (tw), pathwidth (pw), vertex integrity (vi), feedback vertex set (fvs), vertex cover (vc), and distance to clique (dtc). For the definitions of treewidth and pathwidth we refer the reader to [6]; fvs, vc, and dtc denote the size of the smallest set of vertices whose removal leaves the graph a forest, an independent set, or a clique respectively; while a graph has vertex integrity at most if there exists a set of vertices whose removal results in a graph where all components have size at most . It is known that four of these parameters form a hierarchy, in the sense that for all graphs. We note that all these parameters are closed under vertex deletion and edge contraction, meaning that these operations can only decrease the parameter value of a graph.
2.1 Preprocessing
We present two basic polynomial-time reduction rules for Steiner Orientation, which eliminate cycles and degree--vertices respectively. Applying these rules will never increase the values of our parameters, as the rules use edge contractions and vertex deletions, so in the rest of the paper we will mostly focus on instances where these rules have been exhaustively applied.
Proposition 1 ([19]).
Let be an instance of Steiner Orientation. Let be a mixed graph obtained from by contracting all the cycles and be the corresponding set of terminal pairs. Then is a yes-instance if and only if is a yes-instance. Moreover, is a mixed acyclic graph and can be computed in polynomial time.
Proposition 2.
Let be an instance of Steiner Orientation. If has a vertex of degree in the underlying graph, then we can either correctly conclude that is a no-instance or construct a new instance such that and is a yes-instance if and only if is a yes-instance.
3 NP-hardness
Our main result in this section is to show that Steiner Orientation remains NP-hard even on very restricted families of graphs. We focus on restrictions on the structure of the underlying undirected graph and show that even if the underlying graph is series-parallel and has vertex-deletion distance to a forest of stars of size at most the problem is still NP-complete. Note that all series-parallel graphs have treewidth at most [2, Theorem 41] and are planar [3, Chapter 11.2], while the graph constructed by our reduction has feedback vertex number , pathwidth , and vertex integrity . Since Steiner Orientation is polynomial-time solvable when the underlying graph of the input is a tree (as there exists a unique path between every pair of terminals), our result establishes a sharp dichotomy on the polynomial-time solvability of Steiner Orientation with respect to the treewidth of the input graph. Moreover, by slightly modifying our reduction we further obtain NP-hardness for grid graphs of bounded pathwidth.
Theorem 3.
Steiner Orientation is NP-complete on series-parallel graphs of vertex-deletion distance to a forest of stars of size at most .
Proof.
It is easy to see that Steiner Orientation belongs to NP, thus in the rest of the proof we argue about its NP-hardness. The starting point of our reduction is the Monotone 3-SAT problem, which is the variation of 3-SAT where every clause contains at most 3 literals and is monotone, that is, it contains only unnegated or only negated variables. This variation is well-known to be NP-hard [8, 12].
Let be an instance of Monotone 3-SAT, where denotes its variables and its clauses. We say that a clause is positive if it consists of only unnegated variables, and negative if it consists of only negated variables.
We will construct an instance of Steiner Orientation that is equivalent to . For each variable , introduce vertices that are connected via an undirected edge. We further introduce vertices and , as well as the arcs and , for all . Now let be a positive clause containing 3 variables, that is, for distinct . We construct the corresponding clause gadget as depicted in Figure 1. In particular, we introduce vertices , all of which have an incoming arc from , as well as a vertex that is connected via undirected edges with and has an incoming arc from . We further introduce the terminal pairs into . We treat positive clauses that contain 2 variables in an analogous way, while the construction for the negative clauses is entirely symmetric.
This completes the construction of the instance of Steiner Orientation. It is easy to see that is series-parallel, while is a forest whose connected components are either a , a , or a , thus indeed it holds that , , and . It remains to argue that the instance is equivalent to .
For the forward direction, let be a satisfying assignment for . Consider the following orientation for the undirected edges of . If then we orient the edge as , otherwise if then we orient it as . As for the clauses that contain and the edge , if is a positive clause (resp. negative) then if we orient it as (resp. ), otherwise if we orient it as (resp. ). It suffices to argue that this orientation satisfies all terminal pairs in .
Let be a positive clause involving three variables. We will argue that the described orientation satisfies all terminal pairs introduced due to the clause gadget of . Since is a satisfying assignment for , it holds that there exists such that . Consequently, the arc exists in our orientation, thus the terminal pair is satisfied by the directed path . As for the terminal pair , where , notice that if then it is satisfied by the directed path , while if then it is satisfied by the directed path . The argumentation is similar for positive clauses involving two variables, and symmetric for negative clauses.
For the converse direction, assume there exists an orientation of such that all terminal pairs in are satisfied. Consider the assignment where if and only if the edge has been oriented as . We will prove by contradiction that this is a satisfying assignment for . Let be a positive clause involving three variables, and assume that for all . In that case, for the terminal pair to be satisfied, it follows that the edge has been directed as . Since this holds for all , it contradicts the fact that the terminal pair is satisfied by the orientation. The argumentation is similar for positive clauses involving two variables, and symmetric for negative clauses.
Corollary 4.
Steiner Orientation is NP-complete on grid graphs of constant pathwidth.
4 FPT algorithm by distance to clique
In this section, we give an FPT algorithm parameterized by distance to clique. More precisely, we consider the case where the underlying undirected graph of the input is at most dtc vertex deletions away from being a clique. In a sense, this parameterization is the dense analogue of the parameterization by vertex cover (because a vertex cover of a graph is a clique modulator of its complement). As usual, we will assume that the set whose removal leaves the underlying graph a clique is given to us in the input. The main result of this section is the following.
Theorem 5.
Steiner Orientation can be solved in time .
We establish Theorem 5 starting via a series of reduction rules given by the lemmas below. Throughout we will assume that we are given a set of dtc vertices such that removing from the input graph leaves a mixed graph whose underlying graph is a clique. We will also assume that, using Proposition 1, the input is a mixed acyclic graph.
Lemma 6.
Let be a mixed acyclic graph and a set of vertices such that the underlying graph of is a clique. Then, each vertex in has at most one undirected edge to .
Lemma 7.
In a mixed acyclic graph , let be a clique in the underlying graph of . Then there is no vertex incident to at least two undirected edges in . In other words, the set of undirected edges in forms a matching.
We can now proceed to the proof of Theorem 5. The high-level idea is that by using our previous observations the number of undirected edges incident on is at most ; we will therefore enumerate all possible orientations of these edges and check for each orientation if it can be extended to a feasible solution. The challenge will be in establishing that this check can be performed in polynomial time.
5 Vertex cover number
In this section we consider Steiner Orientation parameterized by the vertex cover number vc of the input graph, arguably one of the most restrictive structural parameterizations one could consider. We first show in Theorem 8 that even in this extremely restrictive setting, the problem remains intractable and prove its W[1]-hardness. As a matter of fact, our reduction implies that the problem does not admit any -time algorithm under the ETH, and our next result is in Theorem 10 to present such an optimal algorithm.
5.1 Hardness
Theorem 8.
Steiner Orientation is W[1]-hard parameterized by the vertex cover number vc of the input graph, and for any computable function it cannot be solved in time under the ETH.
Proof.
In -Multicolored Clique we are given a graph and a partition of into independent sets each of size , and we are asked to determine whether contains a -clique. It is well-known that -Multicolored Clique parameterized by is W[1]-hard and does not admit any -time algorithm, where is any computable function, unless the ETH is false [6]. Let be an instance of -Multicolored Clique, where we assume without loss of generality that (one can do so by adding dummy independent sets connected to all the other vertices of the graph). Recall that we assume that is given to us partitioned into independent sets , where . We will construct in polynomial time an equivalent instance of Steiner Orientation, with .
Construction.
We first introduce the vertices and add the arcs and for all . For all , we further introduce the independent sets and . We fix a bijective function that maps every independent set to a distinct pair , and for all with
-
we add the edge for all ,
-
we add the arc for all ,
-
we add the arc for all ,
-
we add the edge for all .
This completes the construction of the graph , and we refer to Figure 2 for an illustration of a part of it. As for the terminal pairs, we proceed in three steps:
-
1.
We initially add into the pairs and , for all .
-
2.
Next, for all and , we add the terminal pair into , for all . We refer to the terminal pairs added in this step as consistency terminal pairs.
-
3.
Lastly, for distinct , if we add the terminal pairs into , where . We refer to the terminal pairs added in this step as edge-checking terminal pairs.
This completes the construction of the instance .
It is easy to see that is a vertex cover of , thus . To complete the proof, we show the following claim.
Claim 9.
The instance of -Multicolored Clique is a yes-instance if and only if the constructed instance of Steiner Orientation is a yes-instance.
5.2 XP algorithm
In this section, we give an XP algorithm parameterized by vc with complexity , matching our lower bound result.
Theorem 10.
There is an algorithm that solves Steiner Orientation in time .
Proof.
First we note that contracting all mixed cycles as in Proposition 1 does not increase the size of a minimal vertex cover, so we can suppose that our graph is mixed acyclic.
Let be a graph of vertex cover number vc. Let be a vertex cover of size vc. It can be computed in time [13]. First we guess the orientation of the edges of . There are possibilities. Then, for all pairs , we guess if there is, in the final solution, an oriented path with ; if we guessed there is at least one, we guess one such , and orient its edges in consequence. There are possibilities. As we will see in Claim 12, after this guessing phase, as is a vertex cover, the connectivity of in any solution respecting the guesses is already decided. This will allow us to check the existence of such a solution in polynomial time.
Claim 11.
Let , such that at the end of the guessing steps, there are two undirected edges and . In any feasible solution respecting the guesses, either we orient them both from to or from to .
The above claim shows that for any , after the guessing steps, either all of its undirected edges must be oriented from to or from to .
Claim 12.
Let ; in any solution respecting the guesses, if there is a path from to , then there is one that only uses already oriented edges after the guessing steps, except possibly for the first one if , and the last one if .
This claim shows us that after the guessing steps, for any pair of terminals that is not already satisfied, the only way to satisfy them while respecting the guessing steps is to orient the edges of and .
We now argue that there exists a demand pair which should be treated “first”. To see this, consider an auxiliary directed graph which has a vertex for each demand pair, and an arc from to when . If this auxiliary graph contains a directed cycle, this implies that the original instance must be oriented in a way that creates a directed cycle, but since we assumed that is mixed acyclic, this is impossible. Hence, the interesting case is when the auxiliary graph is a DAG, therefore there exists a demand pair such that for all other demands we have,
We can apply the following method: take such a pair (as described in the previous paragraph). If , then orient all undirected edges between and from to . If the demand is now satisfied, that is, there is a path from to using arcs and oriented edges, we remove this demand.
If is still unsatisfied, if , then orient all undirected edges between and from to .
We have now handled the demand : if it is satisfied after the steps above, we remove it from the instance and continue with the remaining demands; otherwise this demand cannot be satisfied and we reject. We eat this method until there are no unsatisfied terminals.
This method is correct: indeed, from Claim 12, after the guessing steps, the satisfaction of only depends on the orientation of the undirected edges incident on . Furthermore, from the same claim, if , in any feasible solution, its undirected edges will only be used to satisfy pairs of terminals that contain . But our choice of terminals ensures that for any such pair , , so . So in a feasible solution respecting the guessing steps, if an undirected edge of is used to satisfy such a pair, it will be oriented from to , so it was safe to select this orientation. For the second step, if is still not satisfied, then from Claim 12, the only way to satisfy it while respecting the guessing steps is, if , to direct one undirected edge between and from to . But from Claim 11, they all have the same orientation, so it was safe to orient all of them from to . If is still unsatisfied after these steps, then, from Claim 12, there is no way to satisfy those terminals while respecting the guessing steps.
The above method can be applied in time , and must be applied at most times. In the end, we have an algorithm of complexity .
6 Parameterized by Number of Edges or Arcs
Arguably one of the most natural ways to structurally parameterize Steiner Orientation is to consider either the number of undirected edges or the number of arcs as a parameter. Our goal in this section is to investigate the complexities of these two parameterizations.
We begin with the parameterization by , which is trivially FPT: one can simply guess the orientation of each edge and then check if this gives a valid solution. The complexity is therefore . Our contribution is to observe that this trivial algorithm is perhaps optimal, as if one could obtain an algorithm of complexity , then the Strong Exponential Time Hypothesis (SETH) would be false. Recall that, informally, the SETH states that there is no algorithm for SAT running faster than the brute-force algorithm enumerating all assignments. We show the lower bound by reusing a simple reduction from SAT which appeared in [1].
Theorem 13.
If there exists an such that Steiner Orientation can be solved in time , then the satisfiability of a CNF formula with variables can be decided in time , hence the SETH is false.
The main result of this section is then to establish that the parameterization by also gives a fixed-parameter tractable problem, and indeed that we are again able to obtain a single-exponential parameter dependence. This parameterization is significantly more challenging, so we will need to rely on structural properties obtained by any graph where is small after we apply some simple reduction rules. The main result we obtain is stated below.
Theorem 14.
Steiner Orientation admits a algorithm.
Our high-level strategy will be made up of two parts. First, we define a (very) restricted special case of Steiner Orientation, where, notably, all undirected components are paths (and we have some additional restrictions). With those severe restrictions, this case becomes simpler. In particular, we will show that it admits an polynomial algorithm, via a reduction to 2-SAT. Second, we will show how a branching procedure can reduce any initial instance into a collection of at most instances of the restricted problem. The result will then follow by composing the two algorithms. In order to ease presentation, we start with the algorithm for the restricted case in Section 6.1 and then give the algorithm for parameter in Section 6.2.
6.1 A Restricted Case
We define a restricted case of Steiner Orientation as follows:
Definition 15.
An instance of Steiner Orientation is called restricted if we have the following: all vertices of mixed degree at least are not incident on any unoriented edges, only arcs.
Intuitively, a restricted instance which is also mixed acyclic is an instance where each non-trivial undirected component is a path (because the maximum degree induced by is and we have no cycles), the internal vertices of each such path have no arcs connecting them to the outside, and furthermore each endpoint of such path has only one arc. In the following, we will show that these restricted instances are polynomial time solvable.
Our strategy to handle restricted instances of Steiner Orientation will be the following: first, we simplify our instance by making several observations allowing us to orient several edges deterministically. Then, we encode the obtained instance as a 2-SAT formula, by defining for each terminal in an undirected path a variable which encodes whether this vertex can reach (or be reached by) one endpoint of its path or the other in the final solution, and verifying that each terminal pair is satisfied.
Lemma 16.
There is an algorithm that takes a restricted Steiner Orientation instance that is mixed acyclic and decides if a solution exists in time .
6.2 FPT algorithm by Number of Arcs
Proof of Theorem 14.
We begin by applying Proposition 1 and Proposition 2 exhaustively. This does not increase , so we can assume that the input is mixed acyclic and has no vertices of degree at most . Our algorithm is now the following: take all vertices of mixed degree or more, and for each possible orientation of their edges, create a new instance. We claim that we obtain at most restricted instances, such that at least one of them will have a solution if and only if the original instance did.
First, we argue that if we perform this branching on all vertices of mixed degree or more, we obtain an instance conforming to Definition 15. Indeed, after the orientation, all vertices of mixed degree are not incident on any unoriented edges, only arcs.
In order to bound the number of instances, let us count the number of edges to orient. We will need the following lemma:
Claim 17.
Let be an undirected forest, be the set of vertices of degree at least in and the set of vertices of degree . Then, .
Armed with this claim, let us continue: take composed of the non-trivial connected components of . As is mixed acyclic, it is a forest. Furthermore, as does not contain any leaf, each leaf of has at least one arc. Let be the set of leaves of with a unique arc, be the set of leaves of with two arcs or more, the set of vertices with two edges and at least one arc, and the set of vertices with at least edges. We need to orient the unoriented edges of and , which make edges. But, as each arc has only two endpoints, . And, from the previous claim, . Therefore, :, so we need to orient at most edges, thus obtaining at most restricted instances.
7 Kernelization
In this section we show that any instance of Steiner Orientation admits a polynomial kernel with respect to parameter , where vc is the size of a minimum vertex cover of and is the number of terminal pairs.
In particular we will prove that:
Theorem 18.
Steiner Orientation admits a kernel of order , where vc is the size of the minimum vertex cover of and is the number of terminal pairs.
The high-level idea is that in the final kernel we will keep (i) the vertices of the vertex cover (which are ) (ii) all terminals (which are ) (iii) additional vertices from the independent set. Similarly to the XP algorithm for parameter vertex cover, we use the idea that once we have fixed all paths of length at most between vertices of the vertex cover, this is sufficient to fully determine connectivity in the graph. Therefore, at most vertices from the independent set are needed to form the solution. The challenge is then to identify a set of that size which is always sufficient and we achieve this via a reduction to Maximum Matching.
8 FPT by Treewidth plus Number of Terminals
Our goal in this section is to show that even though Steiner Orientation is NP-hard for graphs of constant treewidth and also W[1]-complete parameterized by the number of terminals , it is in fact FPT when parameterized by the two parameters together. In order to ease presentation we will avoid giving an argument based on a dynamic programming algorithm and will prefer to instead rely on Courcelle’s theorem [5]. This will of course have the disadvantage that we obtain an algorithm with running time of the form , where the function is not explicitly bounded (and could be a tower of exponentials). This is sufficient for our purpose of classifying the complexity of this case as FPT, but we leave it as an interesting open problem to determine the best parameter dependence one can achieve. We in fact establish the following slightly stronger claim:
Theorem 19.
Steiner Orientation is FPT parameterized by the treewidth of the augmented underlying graph, that is, the treewidth of the graph obtained by taking the underlying graph of the input and adding for each terminal pair the edge to the graph.
We observe that Theorem 19 implies that Steiner Orientation is FPT parameterized by treewidth plus (the number of terminals), because adding the extra edges to the underlying graph can increase its treewidth by at most .
9 Conclusion
Even though we have characterized the complexity of Steiner Orientation for all possible values of treewidth (the only polynomial case is when the input is a forest), our NP-completeness only applies for graphs of pathwidth : is the problem in P or NP-complete for graphs of pathwidth . A similar question can be asked for feedback vertex set, where we show hardness when the feedback vertex set has size at least : does the problem become tractable on graphs which are one vertex away from being forests? On the parameterized complexity side, even though we obtain a algorithm, the base in the exponential is large (), so improving this is a natural question.
References
- [1] Esther M. Arkin and Refael Hassin. A note on orientations of mixed graphs. Discret. Appl. Math., 116(3):271–278, 2002. doi:10.1016/S0166-218X(01)00228-1.
- [2] Hans L. Bodlaender. A partial k-arboretum of graphs with bounded treewidth. Theor. Comput. Sci., 209(1-2):1–45, 1998. doi:10.1016/S0304-3975(97)00228-4.
- [3] Andreas Brandstädt, Van Bang Le, and Jeremy P. Spinrad. Graph classes: a survey. SIAM, 1999.
- [4] Rajesh Chitnis, Andreas Emil Feldmann, and Ondrej Suchý. A tight lower bound for planar steiner orientation. Algorithmica, 81(8):3200–3216, 2019. doi:10.1007/S00453-019-00580-X.
- [5] 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.
- [6] Marek Cygan, Fedor V. Fomin, Lukasz Kowalik, Daniel Lokshtanov, Dániel Marx, Marcin Pilipczuk, Michal Pilipczuk, and Saket Saurabh. Parameterized Algorithms. Springer, 2015. doi:10.1007/978-3-319-21275-3.
- [7] Marek Cygan, Guy Kortsarz, and Zeev Nutov. Steiner forest orientation problems. SIAM J. Discret. Math., 27(3):1503–1513, 2013. doi:10.1137/120883931.
- [8] Andreas Darmann and Janosch Döcker. On simplified NP-complete variants of Monotone 3-Sat. Discret. Appl. Math., 292:45–58, 2021. doi:10.1016/J.DAM.2020.12.010.
- [9] Britta Dorn, Falk Hüffner, Dominikus Krüger, Rolf Niedermeier, and Johannes Uhlmann. Exploiting bounded signal flow for graph orientation based on cause-effect pairs. Algorithms Mol. Biol., 6:21, 2011. doi:10.1186/1748-7188-6-21.
- [10] Michael Elberfeld, Danny Segev, Colin R. Davidson, Dana Silverbush, and Roded Sharan. Approximation algorithms for orienting mixed graphs. Theor. Comput. Sci., 483:96–103, 2013. doi:10.1016/J.TCS.2012.03.044.
- [11] Iftah Gamzu and Moti Medina. Improved approximation for orienting mixed graphs. Algorithmica, 74(1):49–64, 2016. doi:10.1007/S00453-014-9932-2.
- [12] E. Mark Gold. Complexity of automaton identification from given data. Inf. Control., 37(3):302–320, 1978. doi:10.1016/S0019-9958(78)90562-4.
- [13] David G. Harris and N. S. Narayanaswamy. A faster algorithm for vertex cover parameterized by solution size. In Olaf Beyersdorff, Mamadou Moustapha Kanté, Orna Kupferman, and Daniel Lokshtanov, editors, 41st International Symposium on Theoretical Aspects of Computer Science, STACS 2024, March 12-14, 2024, Clermont-Ferrand, France, volume 289 of LIPIcs, pages 40:1–40:18. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPICS.STACS.2024.40.
- [14] Rafael Hassin and Nimrod Megiddo. On orientations and shortest paths. Linear Algebra and its Applications, 114-115:589–602, 1989.
- [15] Florian Hörsch. Maximum reachability orientation of mixed graphs, 2025. doi:10.48550/arXiv.2506.16171.
- [16] Alexander Medvedovsky, Vineet Bafna, Uri Zwick, and Roded Sharan. An algorithm for orienting graphs based on cause-effect pairs and its applications to orienting protein networks. In Algorithms in Bioinformatics, 8th International Workshop, WABI 2008. Proceedings, volume 5251 of Lecture Notes in Computer Science, pages 222–232. Springer, 2008. doi:10.1007/978-3-540-87361-7_19.
- [17] Marcin Pilipczuk and Magnus Wahlström. Directed multicut is W[1]-hard, even for four terminal pairs. ACM Trans. Comput. Theory, 10(3):13:1–13:18, 2018. doi:10.1145/3201775.
- [18] Mehdy Roayaei. On the parameterized complexity of the problem of inferring protein-protein interaction directions based on cause-effect pairs. Netw. Model. Anal. Health Informatics Bioinform., 8(1):11, 2019. doi:10.1007/S13721-019-0194-4.
- [19] Dana Silverbush, Michael Elberfeld, and Roded Sharan. Optimally orienting physical networks. J. Comput. Biol., 18(11):1437–1448, 2011. doi:10.1089/CMB.2011.0163.
- [20] Michał Włodarczyk. Parameterized inapproximability for steiner orientation by gap amplification. In 47th International Colloquium on Automata, Languages, and Programming, ICALP 2020, volume 168 of LIPIcs, pages 104:1–104:19. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2020. doi:10.4230/LIPICS.ICALP.2020.104.
