In this paper always denotes an undirected connected graph, parallel edges are allowed but loops are not. We use , for the degree of a vertex and for the number of edges going from to . For a function , we use the notation for any .
In a digraph, the indegree (number of incoming arcs) of a vertex (or of a set ) is denoted by (or , resp.) and the outdegree is denoted by (or , resp.).
The first named author proposed to study the complexity of the following problem in 2009 in Category “Orientations” of EgresOpen .
Problem 1 ().
Given and and positive integers , decide whether has an acyclic orientation where for every vertex , there are pairwise arc-disjoint directed paths from to , and pairwise arc-disjoint directed paths from to .
In this paper we settle the complexity of this problem by show that it is NP-complete, already for .
A more general problem that plays a central role in this note, is the following. We are given and two functions and with for each . An orientation of is called -bounded if for each .
Problem 2 (Degree constrained acyclic orientation problem).
Given , decide whether has an acyclic -bounded orientation.
Note that is a lower bound for the indegree of while is a lower bound for the outdegree of as we are dealing with orientations, so .
Problem 1 is equivalent to the degree constrained acyclic orientation problem if and for all ; and .
Proof. If the prescribed pairwise arc-disjoint directed paths exist, then obviously for every we have and .
Suppose we have an orientation where all have and . This orientation defines a (not necessarily unique) topological order, , such that for every directed edge we have (we may suppose and ). By symmetry and by Menger’s theorem, it is enough to prove that for any if , then . Let be the first vertex of . As we have . Clearly .
2 Polynomially solvable cases
First we examine the special case of Problem 2 when for all , i.e., only lower bounds on the indegrees are given. For a set , we call a vertex a potential source if .
For every non-empty set , there exists an which is a potential source for .
Theorem 2 (Folklore).
Proof. If the orientation exists, then for each take as the first vertex of it (by a topological order). Clearly .
Suppose Condition 1 is satisfied. By applying it to , we obtain a vertex with . Let and for any let . Clearly Condition 1 is satisfied for the new and , thus, by induction, there is an acyclic orientation of where the indegrees are lower-bounded by . The required orientation of is given by orienting the edges incident with from .
If, at some point of this recursive process, we do not have any vertex such that the current is , then the set of the current vertices violates Condition 1. Otherwise we get the orientation required, thus by the first part of the proof Condition 1 is satisfied.
We can go a little bit further.
If and for every (i.e., every vertex has either only a lower bound or only an upper bound on the indegree), then we can decide in polynomial time whether there is an -bounded acyclic orientation of .
Proof. Let , by the condition of the theorem these three sets partition . Call an acyclic orientation ABC if there is a topological order where the vertices of come first, then the vertices of , and finally the vertices of . It is easy to observe that if an -bounded acyclic orientation of exists, then there is another one which is ABC. Let , and for . Furthermore let and for . By Theorem 2, we can check in polynomial time whether there is an -bounded acyclic orientation of and whether there is an -bounded acyclic orientation of .
We call a vertex strict if . The next special case we study is, when every vertex is strict.
Proof. Observe that if , then for every if and only if for every .
We have one more sporadic example where the problem is known to be in P, see Theorem 9 in the last subsection.
3 NP-complete cases
The degree constrained acyclic orientation problem (Problem 2) is NP-complete.
We prove a much stronger theorem about a very restricted version of Problem 2.
The degree constrained acyclic orientation problem is NP-complete even if every vertex is -lower-bounded by 0 or 1 (i.e., and ) except one vertex y, which is strict (i.e., ).
Proof. As the problem is obviously is in class NP, it is enough to show its hardness. We reduce the well-known NP-complete problem Vertex-Cover  to this restricted version. In the problem Vertex-Cover, a graph and an integer is given and we have to decide whether there is a set with such that every edge has at least one endvertex in .
Given and , we need to construct and functions . Let (where ). Let and is incident to , where the last edge-set is meant to have parallel edges between and any vertex . The construction of is finished, its degree-function is denoted by .
Let for , for and . Let for , for and . We need to prove that has a cover of size if and only if has an acyclic orientation satisfying these degree bounds. First suppose is such a cover and let denote the edges with both endvertices in . As is a cover, every edge in connects to . Define an order on as follows. We start by putting vertices of (in any order), then elements of , then , and finally vertices of (in any order). We still need to place each , we put such an edge between and (thus it will precede exactly one of its endvertices). This order defines an acyclic orientation of (edges oriented from earlier vertex to the later one). The indegree of any is exactly one and , thus this acyclic orientation is indeed -bounded.
For the other direction, suppose there exists an acyclic -bounded orientation of , and fix any topological order. First we claim that is preceded by every and by exactly elements of (call this latter subset ). If is preceded by at most elements of , then . If is preceded by at least elements of , then . Accordingly, exactly vertices of precedes , and as its indegree is exactly , necessarily every must also precede it.
It remains to prove that is a cover in . Suppose this is not the case, there is an with and . As precedes and precedes both and , , a contradiction.
The graph used in the proof is not simple. However, one can split every edge of with a new vertex and define . This gives the following corollary.
The degree constrained acyclic orientation problem for simple graphs is NP-complete even if for every vertex either (i.e., is strict) or and ( is lower-bonded by 0 or 1).
Problem 1 is NP-complete.
Proof. We reduce Problem 2 to Problem 1. Given , we construct an instance of Problem 1 as follows. First we fix as the maximum degree in . We add two new vertices, and . Then for each vertex we add parallel edges between and , and we also add parallel edges between and . Let denote the resulting graph (where ).
By Claim 1, it is enough to show that the following are equivalent.
has an acyclic orientation with source and sink where for every , we have and .
has an acyclic -bounded orientation.
First suppose we have the above acyclic orientation of . After deleting and , we get an acyclic orientation of where, for every , we have , and .
Next suppose we have an acyclic orientation of where for every we have . To orient , we keep the orientation of the original edges and orient the edges of form from to , and the edges of form from to ; resulting in an acyclic orientation of . As , we get . We also have .
3.1 Problem 1 for small values
We proved that Problem 1 is NP-complete if and are part of the input. What can we say about its status if and are fixed small numbers?
The first case is well known, it was solved in  where -numbering was introduced.
Theorem 9 ().
If is fixed to one, then we can answer Problem 1 in polynomial time, namely there is a required orientation if and only if is biconnected.
On the other hand, we can prove the following.
Problem 1 is NP-complete for .
Proof. The problem is obviously in NP. We will reduce the problem Not-all-Equal 3SAT  to it. In the problem Not-all-Equal 3SAT there are variables and clauses , each clause contains exactly three literals (a literal is a variable or a negated variable), and we need to decide whether there is a truth assignment to the variables such that every clause has at least one True and at least one False literal in it. Given a Not-all-Equal 3SAT instance, we first construct the multigraph as follows.
First we add edges to make the “skeleton”. We add two parallel edges between and for . We also add one edge between and for . Then we connect to and to , and we also connect to and to for . To finish the skeleton we connect to and to for .
We are left to connect the literals to the skeleton. For , we connect both and to and . Then for , we connect to the three literals it contains. Finally we add two parallel edges between and any literal, and also between and every literal.
The construction of is finished, see Figure 1.
Note that the vertices have degree four as well as vertices and , while vertices have degree five.
First we show that if we have an assignment to the variables such that every clause has at least one and at most two True literals in it, then we can make an acyclic orientation of where for every vertex we have and . We give the orientation by defining the topological order. First we define the order of the skeleton:
Note that the vertices are ordered by the indices, and every is between its two neighbors. So far each has indegree 2 and outdegree 2 for and vertices have indegree 1 and outdegree 1. Finally we place all the True literals between and (in any order), and we place all the False literals between and (in any order). First note that due to the parallel edges added at the end, every literal has at least two incoming and at least two outgoing arcs. As any vertex or is preceded by the True literal, and succeeded by the False literals, every and has indegree and outdegree exactly two. Finally, a clause is preceded by its True literals, we have one or two of them, consequently either its indegree is two and its outdegree is three, or vice versa.
It remains to show that if the required acyclic orientation exists, then we have an assignment to the variables such that each clause gets one or two True values. Take the topological order of a good acyclic orientation. First we claim that the skeleton is in the same order as we defined in the previous part. Suppose for a contradiction that is the smallest index such that precedes . In this case has at least three incoming arcs, so this case is impossible. Next suppose that is the first vertex from which is not between its two -neighbors. If it is before that place, then its lower-indexed -neighbor has indegree three, if it is after that place, then its higher-indexed -neighbor has outdegree three. Next observe that for all , one of and must be before (consequently before ) and the other must be after (consequently after ), since otherwise either or does not have the prescribed indegree two. Now we can define the assignment: a literal is True if it precedes . To finish the proof, observe that if has for example three True literals, then its indegree is four, so its outdegree is only one.
The graph used in the above proof is not simple, actually the answer is always NO for a simple graph, as the second vertex cannot have two incoming arcs. However, one can split any edge of with a new degree four vertex that is connected to . Such a must necessarily be between and , thus their in- and outdegrees will not be affected. This way we can obtain a graph that is almost simple - only edges adjacent to or might have multiplicity .
By splitting into two vertices, and , and similarly into and , and dividing the multiple edges among them, we obtain that the following problem is NP-complete.
Given a simple graph and , decide whether there is an order of the vetrtices such that every vertex has at least neighbors preceding it and also at least neighbors succeedenig it.
Some of the questions left open are the following.
Open Problem 1.
Is Problem 1 in P for the special case and ?
Open Problem 2.
Open Problem 3.
Open Problem 4.
-  Acyclic orientation with connectivity prescriptions EgresOpen, lemon.cs.elte.hu/egres/open/Acyclic_orientation_with_connectivity_prescriptions
-  A. Lempel, S. Even and I. Cederbaum An algorithm for planarity testing of graphs Theory of Graphs : International Symposium, July 1966 (ed. P. Rosenstiehl) pp. 215-232, 1967.
-  M. Garey and D. Johnson Computers and Intractability, Freeman, 1979.