Exploiting bounded signal flow for graph orientation based on causeeffect pairs
 Britta Dorn^{1},
Affiliated with
 Falk Hüffner^{2}Email author,
Affiliated with
 Dominikus Krüger^{3},
Affiliated with
 Rolf Niedermeier^{2} and
Affiliated with
 Johannes Uhlmann^{2}
Affiliated with
DOI: 10.1186/17487188621
© Dorn et al; licensee BioMed Central Ltd. 2011
Received: 22 March 2011
Accepted: 25 August 2011
Published: 25 August 2011
Abstract
Background
We consider the following problem: Given an undirected network and a set of senderreceiver pairs, direct all edges such that the maximum number of "signal flows" defined by the pairs can be routed respecting edge directions. This problem has applications in understanding protein interaction based cell regulation mechanisms. Since this problem is NPhard, research so far concentrated on polynomialtime approximation algorithms and tractable special cases.
Results
We take the viewpoint of parameterized algorithmics and examine several parameters related to the maximum signal flow over vertices or edges. We provide several fixedparameter tractability results, and in one case a sharp complexity dichotomy between a lineartime solvable case and a slightly more general NPhard case. We examine the value of these parameters for several realworld network instances.
Conclusions
Several biologically relevant special cases of the NPhard problem can be solved to optimality. In this way, parameterized analysis yields both deeper insight into the computational complexity and practical solving strategies.
Background
Current technologies [1] like twohybrid screening can find protein interactions, leading to proteinprotein interaction (PPI) networks, but cannot decide the direction of the interaction. This can be complemented by gene knockout experiments which constitute a way to determine causal relations in these networks, thus providing additional information on possible directions of information flow in them [2]. Given a list of socalled causeeffect pairs, the challenge consists in deducing an orientation of the PPI network which takes into account the causal relations of as many of these pairs as possible. Medvedovsky et al. [3] formalize this in terms of a graph theoretical problem as follows.
Problem Formalization
Let G = (V, E) be an undirected graph. An orientation of G is a directed graph = (V, ) obtained from G by replacing every undirected edge {u, v} ∈ E by a directed one, i. e., either by (u, v) ∈ or by (v, u) ∈ . Let P ⊆ V × V be a set of ordered source–target pairs, which we sometimes refer to as "signals". In order to distinguish pairs from edges or arcs, we use the notation [a, b] ∈ P to denote the pair starting in a and ending in b. We say that a pair [a, b] ∈ P is satisfied by a given orientation if there exists a directed path from a to b in . The central problem considered in this work is to find an orientation of a given graph maximizing the number of satisfied pairs. As pointed out by Medvedovsky et al. [3], we can assume that the given graph is a tree: it is clearly optimal to orient the edges of a cycle to form a directed cycle, and hence one can repeatedly contract a cycle to a single vertex, obtaining a tree. Note that this process will always produce the same tree independent of the order of contractions, since two vertices will be merged eventually if and only if they are in the same bridge block, where a bridge block is a connected component of the graph that is obtained by deleting all bridges (edges whose deletion increases the number of connected components). Further, bridge blocks can be found in linear time [4, 5]. Thus, formalized as a decision problem, MAXIMUM TREE ORIENTATION is defined as follows.
Maximum Tree Orientation (MTO)
Input: An undirected tree T, a set P of ordered pairs of vertices of T, and an integer k ≥ 0.
Question: Is there an orientation of T such that at most k pairs in P are not satisfied?
We also consider the weighted version, called WEIGHTED MAXIMUM TREE ORIENTATION (WMTO), where every pair [a, b] ∈ P is associated with a rational weight ω([a, b]) ≥ 0, and the goal is to maximize the sum of weights of the satisfied pairs. Throughout this work, n denotes the number of vertices in the given MTO instance, if not stated otherwise.
As sketched before, MTO is motivated from the inference of causal relations in biological networks [6, 7] such as PPI networks, but it also has applications in the context of communication networks, where several oneway connection request pairs are given. Since each link between two network nodes can only be used in one direction, one has to orient the links in such a way that as many communication requests as possible can be fulfilled.
Previous Work
MTO was introduced by Medvedovsky et al. [3]; they showed that the problem is NPcomplete even when the underlying tree is a star (that is, a diametertwo tree) or a tree with maximum vertex degree three. Moreover, they provided a cubictime algorithm for MTO restricted to paths. Seeing MTO as the task to maximize the number of satisfied pairs, Medvedovsky et al. also provided polynomialtime approximation algorithms with approximation factor 1/4 in the case of stars and O(1/log n) in the case of general nvertex trees. The latter approximation factor was recently improved to O(log log n/log n) by Gamzu et al. [8], who furthermore extended the studies of MTO to "mixed graphs" where some of the edges are already oriented based on causal relations known in advance. Besides these theoretical investigations, Medvedovsky et al. [3] also provided some experimental results based on a yeast PPI network and some synthetic data. Silverbush et al. [9] recently formulated a polynomialsize integer linear program for the generalization of mixed graphs and did some experiments with it. Also recently, Gitter et al. [10] considered graph orientation with the objective of maximizing the weight of all satisfied paths between sources and targets with length at most some constant k. They used approximation algorithms to discover pathways in biological networks. In an earlier work, Hakimi et al. [11] studied the special case of MTO where the list of pairs to be satisfied contains all possible pairs; they developed a quadratictime algorithm for this case.
Our Contributions
We mainly continue and complement previous work on MTO [3, 8] by starting a parameterized and multivariate complexity analysis of MTO. That is, we try to better understand the border between tractable and intractable cases of MTO while sticking to optimal (instead of approximate) solutions. In particular, our focus is on the "amount of signal flow" over vertices and edges, respectively, and how this influences the computational complexity of MTO.

We show that WMTO can be solved in time on an nvertex tree, where m _{ v }denotes the maximum number of connecting paths (onetoone corresponding to the input vertex pairs) over any tree vertex. In other words, WMTO is fixedparameter tractable with respect to the parameter m _{ v }.

We introduce the concept of cross pairs and show that crosspairfree instances of WMTO can be solved in quadratic time, as a corollary also improving the cubictime algorithm of Medvedovsky et al. [3] for MTO on paths to quadratic time.

We additionally show that WMTO is fixedparameter tractable with respect to the parameter q _{ v }which is the maximum number of cross pairs over any vertex; namely, it can be solved in time.

Shifting the focus from "maximum vertex signal flow" to "maximum edge signal flow", we show a sharp complexity dichotomy: WMTO can be solved in linear time if no tree edge has to carry more than two signals, but if this maximum edge signal flow is three, MTO already becomes NPhard.

Finally, we briefly discuss some practical aspects of exactly solving the so far very few considered realworld instances and conclude that these can be already solved to optimality within milliseconds (via at least three different strategies). However, we also make the point that with the future availability of further realworld data, our new algorithms could be of significant practical relevance beyond so far known or straightforward approaches.
Preliminaries, Basic Facts, and Simple Observations
For ease of presentation, for a WMTO instance (T, P, ω), we always assume that ω([s, t]) = 0 for all pairs s, t ∈ V with [s, t] ∉ P. Moreover, subsequently mostly referring to MTO, the presented concepts and definitions clearly apply to WMTO as well. Note that in a tree T = (V, E), for each ordered pair [a, b] of vertices, there exists a uniquely determined path connecting these vertices. We will therefore often write the path defined by the pair [a, b] when we refer to the unique path in the tree starting in vertex a and ending in vertex b, or talk about pairs and paths interchangeably. Sometimes, we also talk about paths in the tree which do not necessarily correspond to pairs. We denote the undirected path connecting vertices v and w in T by path_{ T }(v, w). Moreover, P _{ v }: = {[s, t] ∈ P  v ∈ V (path_{ T }(s, t))} denotes the set of paths passing through a vertex v (note that this includes paths of which v is an endpoint). An MTO instance is called rooted if the underlying tree T is rooted. In a rooted tree T = (V, E), if vertex a ∈ V is an ancestor of vertex b ∈ V, then we use the notation a ≺ b. The subtree of T rooted at v ∈ V is denoted T _{ v }.
Let (T = (V, E), P) be an MTO instance, and let x, y ∈ P be two pairs. We say that x conflicts with y if there exists no orientation of T for which both x and y are satisfied. From an nvertex MTO instance, we build a so called conflict graph in which each vertex corresponds to an input pair of the MTO instance, and where there is an edge between two pairs if and only if they conflict with each other. More formally, given an MTO instance (T = (V, E), P), the corresponding conflict graph G _{ c }(T, P) is defined G _{ c }(T, P):= (P, E _{ c }) where E _{ c } : = {{u, v}  u, v ∈ P ∧ u conflicts with v}.
The computation of the conflict graph can be done in Θ(n ^{4}) time. It clearly cannot be done faster, because up to O(n ^{4}) conflicts are possible. To achieve the desired bound, we thus need to decide in constant time whether two pairs conflict with each other. This is done using an appropriate data structure and two simple observations: First, in a rooted tree, least common ancestors (LCAs) can be calculated in constant time after some linear time preprocessing [12]. Second, two pairs are in conflict if and only if their paths run in different directions through an edge incident on the lower one of the two LCAs of the two pairs. Clearly, for an orientation of (T, P), in G _{ c } there are no edges (that is, conflicts) between the vertices corresponding to the satisfied source–target pairs, and hence the vertices corresponding to the nonsatisfied source–target pairs form a vertex cover for G _{ c }, that is, a vertex set V' ⊆ P such that for every edge e ∈ E _{ c } at least one endpoint of e is in V'. This yields the following useful observation.
Proposition 1. Finding a minimumweight vertex cover in the conflict graph G _{ c }(T, P) onetoone corresponds to determining a minimumweight set of pairs that cannot be satisfied in (T, P).
It is generally assumed that the fact that a problem is NPhard implies that there is no algorithm that finds an optimal solution and has running time bounded by a polynomial of the size of the input. Parameterized complexity is a twodimensional framework for the analysis of computational complexity [13–15]. One dimension is the input size n, and the other one is the parameter (usually a positive integer). A problem is called fixedparameter tractable (fpt) with respect to a parameter x if it can be solved in f(x) ⋅ n ^{ O } ^{(1)} time, where f is a computable function only depending on x. If a problem is fixedparameter tractable with respect to x, we can hope for efficient optimal solutions as long as the parameter is not too large. Due to Proposition 1 we can immediately conclude that MTO and WMTO are fixedparameter tractable with respect to the parameter "number of pairs" p, since the conflict graph has p vertices and we can find a minimumweight vertex cover by trying all possibilities in 2^{ p } ⋅ n ^{ O } ^{(1)} time. Further, since minimumweight vertex covers can be found in O(1.379^{ k }+ kn) time [16], we have fixedparameter tractability with respect to the parameter "number of unsatisfied pairs", and if all weights are at least one, also with respect to the parameter "total weight of unsatisfied pairs".
Treedecompositionbased algorithms have been successfully applied in the area of computational biology, for instance, in the context of structure–sequence alignment [17]. Informally speaking, the treewidth [15] measures the "treelikeness" of a graph, and a tree decomposition is the "embedding" of a graph into a tree depicting the treelike structure of the graph.
We recall the following definitions from literature [18]: A tree decomposition of a graph G = (V, E) is a pair , where each X _{ i } is a subset of V called bag, and is a tree with node set I and edge set F. The following must hold:
1. ;
2. for every edge {u, v} ∈ E, there is an i ∈ I such that {u, v} ⊆ X _{ i }; and
3. for all i, j, l ∈ I, if j lies on the path between i and l in T, then X _{ i } ∩ X _{ l } ⊆ X _{ j }.
The width of , is max{X _{ i }  i ∈ I}  1. The treewidth of G is the minimum width over all tree decompositions of G.
Methods and Results
Bounded Signal Flow Over Vertices
In this subsection, we investigate how the vertexwise structure of the source–target pairs influences the computational complexity of MAXIMUM TREE ORIENTATION. More specifically, first we consider the parameter m _{ v } denoting the maximum number of source–target paths passing through a vertex. We show that MTO can be solved in O(2^{ mv }⋅ P + n ^{4}) time. In other words, MTO is fixedparameter tractable with respect to the parameter m _{ v }. Motivated by this positive result, we explore in more depth the structure of the source–target paths that pass through a vertex. To this end, we introduce the concept of "cross pairs" and show that for crosspairfree instances MTO can be solved in O(n ^{2}) time. Informally speaking, an instance is crosspairfree if the input tree can be rooted such that for each source–target pair one endpoint is an ancestor of the other one. Then, for a rooted MTO instance a cross pair is a source–target pair such that none of its endpoints is the ancestor of the other endpoint. By refining the solving strategy for crosspairfree instances, we show that MAXIMUM TREE ORIENTATION can be solved in time, where q _{ v } denotes the maximum number of cross pairs passing through a vertex.
All algorithms in this subsection are based on dynamic programming, and, hence, since source–target pair weights can easily be incorporated, extend to WMTO.
Parameter "Maximum Number of Pairs Per Vertex"
Here, we show that WMTO is fixedparameter tractable for the parameter m _{ v } denoting the maximum number of source–target pairs passing through a vertex. To this end, we prove in Theorem 1 that we can construct in polynomial time a tree decomposition of the conflict graph of treewidth at most m _{ v }. Recall that (weighted) MTO is equivalent to (weighted) VERTEX COVER on the conflict graph (see Proposition 1). Thus, the running time follows by the fact that (weighted) VERTEX COVER can be solved in O(2^{tw} n) time, given a tree decomposition of width tw [15].
Theorem 1. On nvertex trees, WEIGHTED MAXIMUM TREE ORIENTATION is solvable in O(2^{ m } v ⋅ P + n ^{4}) time, where m _{ v } denotes the maximum number of source–target pairs passing through a vertex.
Proof. First, we show how to construct a tree decomposition of width m _{ v } of the conflict graph in polynomial time. Let (T = (V, E), P) denote an MTO instance and let G _{ c } = (P, E _{ c }) denote the associated conflict graph. The basic idea is that we can use T as the underlying tree of a tree decomposition of G _{ c } = (P, E _{ c }). More specifically, the tree decomposition is given by 〈{P _{ v }  v ∈ V}, T〉 for all v ∈ V. Recall that P _{ v } denotes the set of source–target pairs passing through v. Observe that each vertex p ∈ P of the conflict graph appears exactly in the bags X _{ v } for all v ∈ V (path_{ T }(p)). Moreover, note that if two source–target pairs p = [s, t] and p' = [s', t'] are in conflict (and hence are adjacent in the conflict graph), then path_{ T }(s, t) and path_{ T }(s', t') have at least one edge and thus at least two vertices in common. Hence, every edge of the conflict graph is contained in at least one of the X _{ v }'s. Thus, all conditions of a tree decomposition are fulfilled. Moreover, the width of this tree decomposition is clearly m _{ v }  1. The conflict graph, the sets P _{ v }, and the tree decomposition can be computed in O(n ^{4}) time. Thus, the overall running time follows by the fact that WEIGHTED VERTEX COVER can be solved in O(2^{tw} P) time, given a tree decomposition of width tw of G _{ c } [15].
Cross Pairs
In Theorem 1, we have shown that WMTO is fixedparameter tractable with respect to the parameter m _{ v }. In the following, will strengthen this result by showing that WMTO is fixedparameter tractable with respect to the parameter "number of a special type of source–target pairs (the socalled cross pairs) passing through a vertex". The idea is to identify a "trivial" (that is, polynomialtime solvable) special case of the problem and then to investigate instances that are close to these trivial instances, their closeness measured in terms of a certain parameter which is referred to as distance from triviality [19, 20].
In the following, we will always consider rooted trees. Informally speaking, a crosspairfree instance only contains source–target pairs whose corresponding paths are directed either towards the root or towards the leaves, but do not change their direction. Crosspairfree instances of WMTO are of special interest since they constitute our "trivial instances".
Definition 1. Let (T = (V, E), P, ω) be an instance of WMTO where T is a rooted tree. A source–target pair p = [a, b] ∈ P is called cross pair if neither a is an ancestor of b nor b an ancestor of a. An instance of WMTO is called crosspairfree if T can be rooted such that P does not contain any cross pairs.
Crosspairfree Instances
Now, we devise a dynamicprogrammingbased algorithm solving WMTO in quadratic time on crosspairfree instances.
Theorem 2. On nvertex trees, WEIGHTED MAXIMUM TREE ORIENTATION for crosspairfree instances with given root can be solved in O(n ^{2}) time.
Proof. Algorithm. We present a dynamic programming algorithm with quadratic running time solving a crosspairfree WMTO instance (T = (V, E), P, ω) with root r. For the presentation of the algorithm, we use the following notation. For v ∈ V, let T _{ v } be the subtree of T rooted at v. For all v, w ∈ V with v ≺ w (that is, v is an ancestor of w) let denote the subtree of T induced by .
For ease of presentation, let . Moreover, let . That is, is the tree consisting of the path path_{ T }(v, w) and the subtree T _{ w } rooted at w, and are the pairs with both endpoints in . Finally, the weight of an orientation of is the sum of the weights of the pairs in satisfied by .
The algorithm maintains an n × n dynamic programming table S, containing for each v, w ∈ V with v ≺ w or v = w the two entries S(v, w) and S(w, v). The goal of the dynamic programming procedure is to fill S in accordance with the following definition.
For all v, w ∈ V with v ≺ w, entry S(v, w) is the maximum weight of an orientation of among all orientations of orienting the path between v and w from v to w (that is, away from the root). Analogously, S(w, v) is the maximum weight of an orientation of among all orientations of orienting the path between v and w from w to v (that is, towards the root). Note that in the case v = w we have that S(v, v) is the weight of an optimal orientation of the subtree rooted at v.
Next, we describe how our algorithm computes the entries of S in accordance with this definition. The weight of an optimal orientation of (T, P) can then be found in S(r, r).
Analogously, A (v, w):= ω ({[s, t ∈ P  s, t ∈ V (path_{ T }(v, w)) ^ t ≺ s}). Moreover, for ease of presentation we assume that A (v, v) = 0.
Correctness
and, hence, S(v, w) is computed correctly. To this end, consider a maximumweight orientation of orienting the edges on path_{ T }(v, w) towards w. If, for a child u _{ i }, contains the arc (u _{ i }, w), then the contribution of the source–target pairs in with at least one endpoint in to the weight of is S(u _{ i }, w); note that no source–target pair of with exactly one endpoint in is satisfied by , and thus the contribution of these pairs is S (u _{ i }, w) (a smaller contribution would contradict the optimality of ). Moreover, if for a child u _{ i } the oriented tree contains the arc (w, u _{ i }), then it follows by a similar argument that the contribution of the paths in with at least one endpoint in is S(v, u _{ i })  A(v, w). The only difference is that the contribution of the source–target pairs with both endpoints in V (path_{ T }(v, w)) is already considered in the above formula, and, hence, must be subtracted from S(v, u _{ i }).
where x is the neighbor of v and y is the neighbor of w on path_{ T }(v, w). This assumes, however, that all the entries of A for pairs with distance l  1 are known before computing the entries of the pairs with distance l. This can be ensured by using a queue (firstinfirstout data structure) as follows. For the computation of A, first, for all edges {v, w} ∈ E with v ≺ w set A(v, w):= ω([v, w]) and A(w, v):= ω([w, v]) (let ω([s, t]):= 0 if [s, t] ∉ P) and append the pair (v, w) at the tail of the queue. After each edge has been processed, proceed as follows. Until the queue is empty, let (x, w) denote the next element at the head of the queue and let v denote the parent of x and let y denote the parent of w in T (if x = r remove (x, w) from the head position of the queue and do nothing else). It is easy to verify that the entries for the pairs (x, w) and (v, y) have already been computed and, hence, can be used to compute A(v, w) and A(w, v) as described above. Finally, we remove (x, w) from the head position of the queue and append (v, w) at the tail of the queue. Clearly, for every pair v, w of vertices with v ≺ w, we need a constant number of operations to compute the two table entries A(v, w) and A(w, v), resulting in an overall running time bound of O(n ^{2}).
Note that if the root of a crosspairfree WMTO instance is not known, it can be calculated in O(nP) time by trying all roots and then checking for each pair if the least common ancestor is one of the two endpoints.
As an immediate consequence of Theorem 2, we can improve the cubictime algorithm for MTO on paths by Medvedovsky et al. [3] to quadratic time. Herein, we use that every path rooted at one of its endpoints results in a crosspairfree instance of MTO.
Corollary 1
WEIGHTED MAXIMUM TREE ORIENTATION on nvertex paths can be solved in O(n ^{2}) time.
Parameter "Maximum Number of Cross Pairs Passing Through a Vertex"
Next, we show that WMTO is fixedparameter tractable with respect to the parameter q _{ v } by extending the dynamic programming algorithm for crosspairfree instances. Formally, q _{ v } is defined as follows. For a rooted WMTO instance (T = (V, E), P) with root r, let Q denote the set of cross pairs. Moreover, for v ∈ V let Q _{ v } := P _{ v } ∩ Q be the set of cross pairs passing through v. With respect to the root r the maximum number q _{ v }(r) of cross pairs passing through a vertex is given by max_{ v∈V }Q _{ v }. Then, q _{ v } is the minimum value of q _{ v }(r) over all possible choices r to root T.
Theorem 3. On nvertex trees, WEIGHTED MAXIMUM TREE ORIENTATION with given root can be solved in O(2^{ qv } ⋅ q _{ v } ⋅ n ^{2} ) time, where q _{ v } denotes the maximum number of cross pairs passing through a vertex.
Proof. The basic idea of the algorithm is to incorporate the cross pairs by trying for every vertex all possibilities to satisfy the cross pairs passing through this vertex. To this end, we extend the matrix S by an additional dimension. As a consequence, the dynamic programming update step becomes significantly more intricate.
Let (T = (V, E), P, ω) be a rooted WMTO instance with root r. For the presentation of the algorithm we use the same notation as in the proof of Theorem 2. In addition, we employ the following definitions. Let w ∈ V. A possibility to satisfy the cross pairs in Q _{ w } is represented by a coloring c _{ w } : Q _{ w } → {0, 1}, meaning that a cross pair q ∈ Q _{ w } must be satisfied iff c _{ w }(q) = 1. Let C _{ w } denote the set of all 0/1colorings of Q _{ w }. Note that . To incorporate the cross pairs, for every v, w ∈ V with v ≺ w or v = w and for every coloring c _{ w }, the dynamic programming table S contains two entries S(v, w, c _{ w }) and S(w, v, c _{ w }). Informally speaking, S(v, w, c _{ w }) denotes the maximum weight of an orientation of under the assumption that all cross pairs q ∈ Q _{ v } with c _{ w }(q) = 1 are "satisfiable" and the edges in path_{ T }(v, w) are oriented from v towards w. Entry S(w, v, c _{ w }) is defined analogously, but here we assume that the edges in path_{ T }(v, w) are oriented from w towards v. For a precise description, we use the following notation. Clearly, we are interested only in colorings c _{ w } of Q _{ w } such that any two cross pairs q, q' ∈ Q _{ w } with c _{ w }(q) = c _{ w }(q') = 1 are not in conflict. We call such a coloring locally feasible. Moreover, we extend the notion "feasible" as follows. As informally described above, we distinguish the two cases that the edges on path_{ T }(v, w) are oriented
(1) from v to w (for entry S(v, w, c _{ w })), or
(2) from w to v (for entry S(w, v, c _{ w })).
For the case (1), a locally feasible coloring c _{ w } is called feasible if for each cross pair [s, t] ∈ Q _{ w } with c _{ w }([s, t]) = 1 orienting the edges on path_{ T }(v, w) from v to w and the edges on path_{ T }(s, t) from s to t is simultaneously possible. Analogously, a locally feasible coloring c _{ w } is feasible for case (2) when orienting the edges on path_{ T }(s, t) from s to t does not contradict the orientation of the edges on path_{ T }(v, w) from w to v.
For a coloring c _{ w } of Q _{ w }, we must ensure that in the considered orientations of all cross pairs q ∈ Q _{ w } with c _{ w }(q) = 1 are satisfiable. Therefore, we call an orientation of consistent with a cross pair [s, t] ∈ Q _{ w } (note that is allowed) if the common edges of and path_{ T }(s, t) are oriented from s to t. Finally, we call an orientation of consistent with a coloring c _{ w } of Q _{ w } if the orientation is consistent with each cross pair q ∈ Q _{ w } with c _{ w }(q) = 1.
With these notations, we can formally define the meaning of the entries of S. For every two vertices v, w ∈ V with v ≺ w or v = w and for every 0/1coloring c _{ w } ∈ Q _{ w } the entry S(v, w, c _{ w }) is ∞ if the coloring c _{ w } is not feasible for case (1). Otherwise, S(v, w, c _{ w }) denotes the maximum weight of an orientation of among all orientations of fulfilling the following constraints:

the edges on path_{ T }(v, w) are oriented from v to w, and

the orientation is consistent with c _{ w }.
This definition ensures that the orientation is not conflicting with the realization implied by the coloring c _{ w } and the fixed orientation of path_{ T }(v, w). The entry S(w, v, c _{ w }) is defined analogously with the difference that here we assume that the edges on path_{ T }(v, w) are oriented from w to v. Note that the cross pairs having only one endpoint in are not contained in , and hence do not contribute to the weight of an orientation of . Observe that is the maximum weight of an orientation of the whole instance (T, P, ω) since and we build the maximum over all colorings of the cross pairs in Q _{ r }. Next, we provide a strategy to compute the entries of S in accordance with this definition. In the update step, we need to adjust the tables of a vertex w with the tables of its children. Doing so, we have to ensure that we only consider colorings that are not contradictory to each other. Let c _{ u } denote a coloring of Q _{ u } and c _{ w } denote a coloring of Q _{ w }. We use c _{ u }c _{ w } to denote that c _{ u } and c _{ w } agree in the coloring of the cross pairs in Q _{ u } ∩ Q _{ w }, that is, for all q ∈ Q _{ u } ∩ Q _{ w } it holds that c _{ u }(q) = c _{ w }(q). Finally, let W_{LCA}(w, c _{ w }) denote the sum of the weights of the cross pairs [s, t] ∈ Q _{ w } with c _{ w }([s, t]) = 1 that have w as their least common ancestor.
Herein, A is defined exactly as in the proof of Theorem 2.
Correctness. For the correctness, we argue that for v, w ∈ V with v ≺ w and for a coloring c _{ w } ∈ C _{ w } that is feasible for case (1), the maximum weight of an orientation of consistent with c _{ w } that orients the edges on path_{ T }(v, w) from v to w is , and, hence, S(v, w, c _{ w }) is computed correctly. To this end, first consider the case that w is a leaf. Then, is identical to path_{ T }(v, w) and Q _{ w } = ∅. Hence, in this case exactly the source–target pairs with s ≺ t are satisfied whose total weight per definition is A(v, w). Second, consider the case that w is an internal vertex with children u _{1}, ..., u_{l}. Moreover, let be an optimal orientation consistent with c _{ w } that orients the edges on path_{ T }(v, w) from v to w. Assume that this orientation contains for a child u _{ i } the arc (u _{ i }, w). Then, with respect to w and u _{ i }, the subgraph of induced by the vertices in is an orientation of consistent with a coloring that clearly agrees with c _{ w }. Thus, the contribution of u _{ i } to the weight of is the maximum over all that agree with c _{ w }. Similarly, if contains the arc (w, u _{ i }) for a child u _{ i }, the subgraph of induced by the vertices in is an orientation of consistent with a coloring that clearly agrees with c _{ w }. Thus, the contribution of the pairs in with at least one endpoint in is the maximum of over all that agree with c _{ w } (here, we have to subtract the number of satisfied pairs with both endpoints on path_{ T }(v, w) that are already accounted for by the term A(v, w) in (8)). Finally, observe that the contribution of the cross pairs q in with c _{ w }(q) = 1 for which w is the least common ancestor are not taken into account in the contributions of the u _{ i }'s. This is done by the term W_{LCA} in (8). The argumentation for the correctness of the computation of S(w, v, c _{ w }) follows analogously.
Running time. Next, we analyze the running time. We use the following notation and implementation details. For w ∈ V let . A coloring c _{ w } : Q _{ w } → {0, 1} is realized by a tuple with for all 1 ≤ i ≤ n _{ w }. Moreover, the dynamic programming table S is realized by two tables and for every pair v, w ∈ V with v ≺ w or v = w with an entry for every coloring where and . The table A is computed exactly as in the proof of Theorem 2 in O(n ^{2}) time in a preprocessing step. Moreover, note that after O(n) preprocessing time, least common ancestors of the source–target pairs can be found in constant time [12].
since O(∑_{ w∈V } deg_{ T }(w)) = O(n) in trees.
Bounded Signal Flow Over Edges
Let m _{ e } be the maximum number of paths that pass through an edge. We consider MTO instances where m _{ e } is limited. We show that the problem is lineartime solvable for m _{ e } ≤ 2, but NPhard for m _{ e } ≥ 3, thereby establishing a dichotomy on the complexity of MTO with respect to m _{ e }.
For the polynomialtime algorithm, we employ the following lemma.
Lemma 1. If m _{ e } ≤ 2, then the treewidth of G _{ c }(T, P) is at most two.
Proof. We make use of the following characterization of graphs of treewidth at most two [21]. A graph has treewidth at most two if it can be reduced to the empty graph by the exhaustive application of the following data reduction rules:
(1) deleting vertices of degree 0 or 1,
(2) deleting a degree2 vertex whose two neighbors are adjacent, and
(3) adding an edge between the two neighbors of a degree2 vertex v if the neighbors are nonadjacent, and subsequently deleting v.
We show that if m _{ e } ≤ 2, then in the conflict graph G _{ c }(T, P) we can find a vertex to which one of the above rules applies. Further, we show that the modified smaller conflict graph is still a conflict graph of some MTO instance. Thus, the claim follows by induction.
Clearly, if Rule (1) or (2) applies to a vertex v in the conflict graph, then we can just delete the corresponding pair in the MTO instance, and the conflict graph of the resulting MTO instance is identical to the graph that results by deleting v.
Next, we show that if neither Rule (1) nor Rule (2) applies, then we can find a vertex v in the conflict graph to which Rule (3) applies. To this end, let (T, P) with T = (V, E) denote an MTO instance and assume that T is rooted at an arbitrarily chosen inner vertex r. Moreover, among all vertices that are the least common ancestors of a pair in P, let x be one with maximum distance to the root r (that is, a deepest least common ancestor). We distinguish two cases based on whether x is an endpoint of a pair with both endpoints in T _{ x }.
First, consider the case that x is the endpoint of a pair [s, t] ∈ P with s, t ∈ V (T _{ x }). Let y be the child of x that is contained in the path between s and t. Observe that by the choice of x there is no pair with both endpoints in T _{ y }. Hence, for every pair that is in conflict with [s, t], the corresponding path contains the edge {x, y}. Thus, since m _{ e } = 2, the pair [s, t] is in conflict with at most one other pair, and therefore the corresponding vertex has degree at most one in the conflict graph: a contradiction to the fact that neither Rule (1) nor (2) apply.
Since widthtwo tree decompositions can be constructed in linear time [21] and weighted VERTEX COVER can be solved in linear time on graphs with constant treewidth [15], this yields lineartime solvability for WEIGHTED MAXIMUM TREE ORIENTATION with m _{ e } ≤ 2.
Theorem 4. If m _{ e } ≤ 2, then WEIGHTED MAXIMUM TREE ORIENTATION can be solved in linear time.
Proof. To be able to determine the path between a pair [s, t] in O(n) time, we root the tree arbitrarily and calculate in linear time a data structure that allows least common ancestor queries in constant time [12]; the path can then be found by going upwards from s and t until hitting their least common ancestor, and then joining the two partial paths. We then construct the conflict graph by marking for each path the corresponding edges with the pair and the direction, and then registering a possible conflict for each tree edge. Since there can be only linearly many markings and conflicts, the construction takes O(n) time. A tree decomposition of width two can then be found in linear time [21], and, as mentioned above, solving weighted VERTEX COVER on a graph with treewidth at most two takes only linear time, too [15].
We can further prove that for m _{ e } ≥ 3, MTO is NPhard even on stars, that is, on trees where all leaves are attached to the same vertex. The proof is by reduction from MAXDICUT.
Theorem 5. MAXIMUM TREE ORIENTATION on stars with m _{ e } ≥ 3 is NPcomplete.
Proof. As Medvedovsky et al. [3] pointed out, the NPhard MAXDICUT problem, defined as follows, can be reduced to MTO on stars.
MAXDICUT
Given a directed graph G = (V, A) and a nonnegative integer k, is it possible to find a subset of vertices C ⊆ V such that there are at least A  k arcs (v, w) ∈ A with v ∈ C and w ∉ C?
From a MAXDICUT instance (G = (V, A), k), one constructs an equivalent MTO instance (T = (V', E), P, k) by setting V':= V ∪ {r}, E := {{v, r}  v ∈ V}, and P := A, where r ∉ V is a new root vertex [3]. Clearly, if a MAXDICUT instance has maximum degree three, then it reduces to an MTO instance with m _{ e } ≤ 3. Thus, it remains to show that MAXDICUT with maximum degree three is NPhard. (Unfortunately, there seems to be no apt reduction from the undirected version MAXCUT, which is NPhard for maximum degree three [22].)
MAXDICUT can also be formulated as the problem to delete up to k arcs to obtain a graph where every vertex is only startpoint or only endpoint of arcs. We can characterize such graphs by a forbidden substructure consisting of three vertices u, v, w connected by the arcs (u, v) and (v, w) (the arcs (u, w) and (w, u) may or may not be present). Thus, if we ignore graphs with multiple arcs between two vertices, we have three forbidden induced subgraphs on three vertices. In this way, MAXDICUT is similar to the TRANSITIVITY DELETION problem [23], which given a directed graph, asks for up to k arc deletions to make it transitive, that is, to fulfill for all u, v, w ∈ V that (u, v) ∈ A ∧ (v, w) ∈ A ⇒ (u, w) ∈ A. Transitive graphs are characterized by two of the three forbidden subgraphs for MAXDICUT; the subgraph with {(u, v), (v, w), (u, w)} ⊆ A is not forbidden. However, if we examine the directed graphs that are produced in the reduction from 3SAT that proves NPhardness of TRANSITIVITY DELETION [23, Sect. 3.1], we notice that this substructure does not occur, and cannot be created by arc deletions. Thus, solving TRANSITIVITY DELETION and MAXDICUT on these directed graphs is equivalent. Since the constructed instances also have degree at most three, we obtain the NPhardness of MAXDICUT with maximum degree three. It is easy to see that MTO is contained in NP, so we obtain the claimed theorem.
Observations on Protein Interaction Networks
The goal in this section is to explore the space of practically meaningful parameterizations, here focusing on biological applications. We first performed experiments based on the same data as used by Medvedovsky et al. [3]. The network is a yeast proteinprotein interaction network from the Database of Interacting Proteins (DIP) [24], containing 4,737 vertices and 15,147 edges. The causeeffect pairs were obtained from gene knockout experiments by Yeang et al. [2] and contain 14,502 pairs. After discarding small connected components and contracting cycles, we obtained a tree with 1,278 vertices and 5,569 pairs. (These numbers differ slightly from the ones stated by Medvedovsky et al. [3]. We do not use the additional kinasesubstrate data, which is only meaningful to evaluate the orientations obtained, and which requires an arbitrary parameter choice not documented by Medvedovsky et al. [3].)
The resulting tree is, as already observed by Medvedovsky et al. [3], very starlike: there is one vertex of degree 1,151 and 1,048 degreeone vertices attached to it. The remaining 229 vertices have degree 1 to 4. All paths connecting causeeffect pairs pass through the central vertex.
We first note that this MTO instance is actually fairly easy to solve exactly. The Integer Linear Program (ILP) by Medvedovsky et al. [3, Sect. 3.1] and VERTEX COVER on the conflict graph solved by either an ILP or a simple branching strategy with data reduction all solve the instance in less than a second. More precisely, the running times are 0.09 s, 0.02 s, and 0.13 s, respectively, on a 2.67 GHz Intel Xeon W3520 machine, using GLPK 4.44 for the ILPs, and with the branching strategy implemented in Objective Caml. The branching strategy finds a vertex v of maximum degree and branches into the two cases of taking v into the vertex cover or taking all neighbors of v into the vertex cover. Before each branch, degree1 vertices are eliminated by taking their neighbor into the vertex cover. The search in the second branch is cut short when the accumulated vertex cover is larger than that of the first branch.
Note that all three algorithms do not require the parameter k (number of unsatisfied pairs) as input, but will determine the minimum k such that there is a solution.
The reason that these strategies work so well is probably due to the low value of the parameter k: only 77 causeeffect pairs cannot be satisfied. This limits the size of the branchandbound tree that underlies all three methods.
Network parameters
Parameter  Value  

n  Number of network vertices  4,654 
m  Number of network edges  15,104 
p  Number of pairs  14,155 
n _{ t }  Vertices in MTO instance  1,278 
p _{ t }  Number of pairs in MTO instance  5,569 
n*  Number of vertices in star  1,049 
m _{ v }  Max. number of pairs per vertex  5,569 
m _{ e }  Max. number of pairs per edge  371 
q  Number of cross pairs  417 
q _{ v }  Max. number of cross pairs per vertex  417 
q'  Number of cross pairs after data reduction  306 
 Max. number of cross pairs per vertex after data reduction  306 
n _{ c }  Number of vertices in conflict graph  1,287 
m _{ c }  Number of edges in conflict graph  4,626 
k  Number of unsatisfiable pairs  77 
Thresholded network parameters
threshold  n  m  p  n _{ t }  p _{ t }  n*  m _{ v }  m _{ e }  q  q _{ v }  q' 
 n _{ c }  m _{ c }  k 

0.000000  5385  39921  14393  799  2014  750  2014  59  7  7  3  3  115  292  17 
0.154420  4530  35041  11522  747  2203  705  2203  298  27  27  20  20  475  1632  40 
0.371369  4254  32135  10740  796  2443  749  2443  275  47  47  35  35  528  2424  46 
0.573290  3871  27128  9445  777  2225  704  2225  268  32  32  13  13  140  311  32 
0.573313  2546  8977  5279  638  2311  477  2310  208  252  252  151  151  561  2394  68 
0.830093  2206  7136  4346  643  2206  449  2206  192  304  304  193  193  727  4017  83 
0.886308  1407  3646  1607  441  787  260  785  45  106  106  88  88  311  1876  75 
0.943001  1135  3069  920  361  464  195  463  32  57  57  42  42  179  801  44 
0.954421  1039  2504  843  350  489  175  461  45  85  73  71  61  215  3001  81 
0.957338  895  2060  681  304  405  119  375  39  64  54  58  50  240  3092  89 
0.965986  874  2018  666  299  477  103  411  165  90  78  85  75  358  12284  110 
0.984753  668  1676  312  206  163  95  162  20  7  7  6  6  55  222  15 
0.989212  581  1322  188  192  167  69  161  86  24  24  24  24  141  1088  32 
0.989233  307  681  71  121  70  32  66  36  21  21  11  11  52  219  7 
0.990409  294  666  28  114  27  26  26  21  2  2  2  2  9  8  2 
We see that, here, the parameter k is not always a clear winner. When the network becomes sparser, the components that will be shrunk to a single vertex by the cycle contraction will be smaller, leaving fewer pairs with both endpoints on the same tree vertex, and thereby increasing the number of potential conflicts. Only for very high thresholds, the parameter becomes small again, since then the original instance is already much smaller. Still, all instances can be solved in less than one second by the three algorithms mentioned above, which exploit low values of k.
We also see that for denser graphs, the parameter values based on the number of cross pairs are quite low, e.g. = 3 for the whole graph. Thus, it seems likely that these instances can be quickly solved by the algorithm from Theorem 3, running in time. One possible explanation for the low value for these parameters is that the networks exhibit a linear structure. For example, if each protein can be assigned a distance to the nucleus, and interactions mostly transport information to or from the nucleus, then we would expect to have only few cross pairs.
The parameter m _{ v } could be expected to be not too high in biological networks, since otherwise this would make the network less robust, since elimination of one vertex would disrupt too many paths. However, one vertex in the tree under consideration can actually correspond to a very large component in the original graph, which weakens this effect. Therefore, this parameter is more useful in sparser graphs, where not too many graph vertices are joined into a tree vertex. However, for the given instances, it seems small enough to be exploited only for fairly small instances, where other parameters would give good results, too.
The parameter m _{ e } could similarly be expected to be low in sparse networks; however, the NPhardness result already for m _{ e } ≥ 3 (Theorem 5) makes practical use of this parameter unlikely.
Conclusions
We started a parameterized complexity analysis of (WEIGHTED) MAXIMUM TREE ORIENTATION, obtaining a more finegrained view on the computational complexity of this NPhard problem. In this line, there are still several challenges for future investigations. For instance, it is open whether MTO is fixedparameter tractable with respect to the parameter "number of satisfied pairs" (n  k). Further, in the spirit of "distancefromtriviality parameterization" [19, 20] it would be interesting to study the parameterized complexity of MTO with respect to the parameter "number of all possible pairs minus the number of input pairs"recall that for parameter value zero MTO is polynomialtime solvable [11]. MTO restricted to stars is still NPhard, but then at least one quarter of all input pairs can always be satisfied [3]. Hence, it would be interesting to study above guarantee parameterization [15, 20] with respect to the number of satisfied pairs. MTO can be translated into a vertex covering problem (see Proposition 1) on a graph class that is K _{4}freethis motivates to study whether vertex covering on this graph class can be done faster than on general graphs. Clearly, MTO brings along numerous further parameters and parameter combinations which can make a more comprehensive multivariate complexity analysis [20] very attractive. Often, it is desirable to not only list a single solution, but to enumerate all optimal solutions. Our dynamicprogrammingbased algorithms seem suitable for this. Following Gamzu et al. [8] and extending the studies for MTO as pursued here to the more general case of mixed graphs with partially already oriented edges is of high interest. First steps in this direction have very recently been undertaken by Silverbush et al. [9] and Elberfeld et al. [26]. Finally, it seems promising to examine the parameters based on cross pairs in other networks such as communication networks, and to try to exploit these parameters for other hard network problems.
Declarations
Acknowledgements
A preliminary version of this work appeared in the proceedings of the 1st International ICST Conference on Theory and Practice of Algorithms in (Computer) Systems (TAPAS '11), volume 6595 in Lecture Notes in Computer Science, pages 104115, Springer 2011.
JU and partly FH were supported by the Deutsche Forschungsgemeinschaft (DFG), research project PABI (NI 369/7).
Major parts of the work were done while BD and DK were with the Universität Tübingen, FH was with the HumboldtUniversität zu Berlin, and RN and JU were with the FriedrichSchillerUniversität Jena. We are grateful to two anonymous referees whose insightful remarks helped to improve the presentation of our work.
Authors’ Affiliations
References
 Werther M, Seitz H, Eds: Proteinprotein interaction. Volume 110. Advances in Biochemical Engineering/Biotechnology. Springer; 2008.
 Yeang CH, Ideker T, Jaakkola T: Physical network models. Journal of Computational Biology 2004,11(2–3):243–262.PubMedView Article
 Medvedovsky A, Bafna V, Zwick U, et al.: An algorithm for orienting graphs based on causeeffect pairs and its applications to orienting protein networks. In Proc 8th WABI. Volume 5251. LNBI, Springer; 2008:222–232.
 Karzanov AV: Èkonomnyj algoritm nahoždeniâ bikomponent grafa [in Russian: An efficient algorithm for finding the bicomponents of a graph]. In Trudy tret'ej zimnej školy po matematičeskomû programmirovaniu i smežnym voprosam [Proceedings of the 3rd Winter School on Mathematical Programming and Related Problems]. Moscow Engineering and Construction Institute (MISI); 1970:343–347.
 Tarjan RE: Depthfirst search and linear graph algorithms. SIAM Journal on Computing 1972,1(2):146–160.View Article
 Alm E, Arkin AP: Biological networks. Current Opinion in Structural Biology 2003,13(2):193–202.PubMedView Article
 Sharan R, Ideker T: Modeling cellular machinery through biological network comparison. Nature Biotechnology 2006, 24:427–433.PubMedView Article
 Gamzu I, Segev D, Sharan R: Improved orientations of physical networks. In Proc 10th WABI. Volume 6293. LNBI, Springer; 2010:215–225.
 Silverbush D, Elberfeld M, Sharan R: Optimally orienting physical networks. In Proc 15th RECOMB. Volume 6577. LNBI, Springer; 2011:424–436.
 Gitter A, KleinSeetharaman J, Gupta A, et al.: Discovering pathways by orienting edges in protein interaction networks. Nucleic Acids Research 2011,39(4):e22.PubMedView Article
 Hakimi SL, Schmeichel EF, Young NE: Orienting graphs to optimize reachability. Information Processing Letters 1997,63(5):229–235.View Article
 Harel D, Tarjan RE: Fast algorithms for finding nearest common ancestors. SIAM Journal on Computing 1984,13(2):338–355.View Article
 Downey RG, Fellows MR: Parameterized Complexity. Springer; 1999.View Article
 Flum J, Grohe M: Parameterized Complexity Theory. Springer; 2006.
 Niedermeier R: Invitation to FixedParameter Algorithms. No. 31 in Oxford Lecture Series in Mathematics and Its Applications, Oxford University Press; 2006.
 Niedermeier R, Rossmanith P: On efficient fixedparameter algorithms for weighted vertex cover. Journal of Algorithms 2003,47(2):63–77.
 Song Y, Liu C, Huang X, et al.: Efficient parameterized algorithms for biopolymer structure–sequence alignment. IEEE/ACM Trans Comput Biology Bioinform 2006,3(4):423–432.View Article
 Bodlaender HL: A partial karboretum of graphs with bounded treewidth. Theoretical Computer Science 1998,209(1–2):1–45.View Article
 Guo J, Hüffner F, Niedermeier R: A structural view on parameterizing problems: distance from triviality. In Proc 1st IWPEC. Volume 3162. LNCS, Springer; 2004:162–173.
 Niedermeier R: Reflections on multivariate algorithmics and problem parameterization. In Proc 27th STACS. Volume 5. Leibniz International Proceedings in Informatics, Schloss Dagstuhl  LeibnizZentrum für Informatik; 2010:17–32.
 Arnborg S, Proskurowski A: Characterization and recognition of partial 3trees. SIAM Journal on Algebraic and Discrete Methods 1986,7(2):305–314.View Article
 Yannakakis M: Edgedeletion problems. SIAM Journal on Computing 1981,10(2):297–309.View Article
 Weller M, Komusiewicz C, Niedermeier R, et al.: On making directed graphs transitive. Journal of Computer and System Sciences 2011.
 Salwinski L, Miller CS, Smith AJ, et al.: The database of interacting proteins: 2004 update. Nucleic Acids Research 2004, (32 Database):D449D451.
 Bruckner S, Hüffner F, Karp RM, et al.: Topologyfree querying of protein interaction networks. Journal of Computational Biology 2010,17(3):237–252.PubMedView Article
 Elberfeld M, Segev D, Davidson CR, et al.: Approximation algorithms for orienting mixed graphs. In Proc 22nd CPM. Volume 6661. LNCS, Springer; 2011:416–428.
This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.