Degree-constrained orientations of embedded graphs

We investigate the problem of orienting the edges of an embedded graph in such a way that the resulting digraph fulfills given in-degree specifications both for the vertices and for the faces of the embedding. This primal-dual orientation problem was first proposed by Frank for the case of planar graphs, in conjunction with the question for a good characterization of the existence of such orientations. We answer this question by showing that a feasible orientation of a planar embedding, if it exists, can be constructed by combining certain parts of a primally feasible orientation and a dually feasible orientation. For the general case of arbitrary embeddings, we show that the number of feasible orientations is bounded by 22g\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$2^{2g}$$\end{document}, where g\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$g$$\end{document} is the genus of the embedding. Our proof also yields a fixed-parameter algorithm for determining all feasible orientations parameterized by the genus. In contrast to these positive results, however, we also show that the problem becomes NP\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$N\!P$$\end{document}-complete even for a fixed genus if only upper and lower bounds on the in-degrees are specified instead of exact values.


Introduction
Graph orientation is an area of combinatorial optimization that deals with the assignment of directions to the edges of an undirected graph, subject to certain problemspecific requirements.Besides yielding useful structural insights, e.g., with respect to connectivity of graphs (Robbins 1939;Nash-Williams 1960) and hypergraphs (Frank et al. 2003), research in graph orientation is motivated by applications in areas such as evacuation planning (Wolshon 2001), graph drawing (Eades and Wormald 1990), or efficient data structures for planar graphs (Chrobak and Eppstein 1991).
A particularly well-studied class of orientation problems are degree-constrained problems, where the in-degree of each vertex in the resulting digraph has to lie within certain bounds.Hakimi (1965) and Frank and Gyárfás (1976) provided good characterizations1 for the existence of such orientations.In this paper, we answer a question raised by András Frank2 , asking for a good characterization for the following problem: Given an embedding of a graph in the plane, is there an orientation of the edges that meets prescribed in-degrees both in the primal and the dual graph at the same time?We show that if such an orientation exists, it is unique and can be computed by combining a feasible orientation for the primal graph with a feasible orientation for the dual graph.Our result generalizes to graph embeddings of higher genus, showing that the number of feasible orientations is bounded by a function of the genus, and the set of all solutions can be computed efficiently as long as the genus is fixed.We also show that the problem becomes NP-complete as soon as upper and lower bounds on the in-degrees are specified instead of exact values.
Our study of degree-constrained embeddings is largely driven by theoretical interest.However, we think that our results might be useful in the future, e.g., for the design of data structures, the layout of graph drawings, or the construction of embedded electronic circuits.In particular, constraining the degree of faces can be used to exclude peripheral cycles, i.e., cycles along the boundary of a face, or to enforce a balance between the number of edges of a face that are orientated clockwise and counterclockwise, respectively.This may be important in electronics, where the direction of the magnetic field around a wire depends on the direction of current, and the magnetic fields generated by the wires around a face should balance out.Another example is graph-drawing, where the orientation of an edge may decide on which side its label is positioned, and we want to limit the number of labels drawn into an individual face.
Outline In the remainder of this section, we give a short introduction to orientations and embedded graphs and discuss related work.Section 2 then deals with the fixeddegree primal-dual orientation problem, which asks for an orientation of a given embedded graph, such that exact in-degree prescriptions are met not only for every vertex but also for every face of the embedding.The section contains two different proofs that yield the answer to Frank's question for a good characterization: Sect.2.1 comprises a combinatorial proof for the uniqueness of the solution in plane graphs, also reducing the problem to solving the original degree-constrained orientation problem once in the primal and once in the dual graph.In Sect.2.2, an alternative proof based on a simple linear algebra argument also yields a bound on the number of feasible orientations in embeddings of higher genus.In Sect.3, we show that if we accept upper and lower bounds on the in-degrees instead of exact values, the problem becomes NPcomplete.Finally, we point out open questions in Sect. 4.

Preliminaries
We give a short introduction to graph embeddings and orientations of those embeddings.Throughout this paper we will assume all graphs to be connected but not necessarily simple, i.e., loops and multi-edges are allowed.While the connectedness assumption is very common in the context of graph embeddings, all results presented here can be extended to non-connected graphs by temporarily introducing additional edges (and adjusting the in-degree specifications accordingly) so as to render the graph connected; see Remark 1 for details.
Embedded graphs An embedding of a graph is a mapping of its vertices and edges onto a closed orientable surface (e.g., a sphere or a torus) such that edges meet only at common vertices.This mapping partitions the surface into several regions, called faces.Throughout this paper, we will restrict ourselves to cellular embeddings, i.e., those embeddings in which every face is homeomorphic to a disk.The dual of an embedded graph is the graph that is obtained by the following procedure: For every face in the embedding, introduce a vertex in the dual graph.For every edge of primal graph, introduce an edge in the dual graph that connects the faces that are adjacent to the original edge.The genus g of the embedding is determined by Euler's formula: If E is the set of edges, V is the set of vertices and V * is the set of faces, then Planar graphs and cycle/cut duality If g = 0, i.e., the graph is embedded in a sphere, the embedding is called planar (as embeddings in spheres and planes are combinatorially equivalent).Planar embeddings have several features that make them particularly interesting.In this work, we will make use of the following fact, called cycle/cut duality, which holds-exclusively-in planar embeddings: A set of edges is a simple cycle in the primal if and only if it is a simple cut3 in the dual and vice versa (Whitney 1932).
Orientation of primal and dual graphs An orientation of a graph is an assignment of directions to its edges, i.e., for every edge we specify one of the two endpoints of the edge as its head and the other as its tail.By convention, we orient the edges in the dual graph in such a way that they cross their primal "alter egos" from right to left; see Fig. 1 for an example.Thus every orientation of the primal graph induces an Primal edges are drawn as solid lines, dual edges are drawn as dashed lines.An edge in the dual graph crosses its corresponding edge in the primal graph from right to left orientation of the dual graph and vice versa.Given an orientation D, we denote the set of edges whose head is the vertex v by δ − D (v) and the set of edges whose tail is v by δ + D (v).In accordance with our convention for dual orientations, we let δ − D ( f ) be the set of edges whose left face is f , and δ + D ( f ) be the set of edges whose right face is f .We mention that our convention for primal and dual orientations extends cycle/cut duality in the sense that a directed simple cycle in the primal is a directed simple cut in the dual and vice versa, where a cut or cycle is directed if all its edges are oriented in the same direction.

Related work
Research in graph orientation has a long history that revealed many interesting structural insights and applications.Classic results include the orientation theorem by Robbins (1939) stating that an undirected graph is 2-edge-connected if and only if it has an orientation that is strongly connected; see also the generalizations by Nash-Williams (1960) and Frank et al. (2003).Graph orientation is also closely related to both graph drawing (Eades and Wormald 1990;Biedl et al. 2005) and network flow theory.We will discuss the latter connection in more detail below.Hakimi (1965) considered the fundamental fixeddegree orientation problem: Given a graph G = (V, E) and in-degree specifica-

Degree-constrained orientations
for every vertex v ∈ V .He showed that a feasible orientation exists if and only if v∈V α(v) = |E| and v∈S α(v) ≥ |E[S]| for all S ⊆ V , where E[S] denotes the set of edges with both endpoints in S.He also gave similar characterizations for the existence of orientations that fulfill either lower or upper bounds on the in-degrees.Frank and Gyárfás (1976) observed that the results for lower and upper bounds can easily be combined in a constructive way to find orientations that fulfill upper and lower bounds at the same time.Also optimization versions of the degree-constrained orientation problem have been studied.Gabow (2006) considered the problem of finding a subset of edges with maximum cardinality that can be oriented without violating any degree constraints, leaving the other edges unoriented.He derives a 3 4 -approximation algorithm for this problem, which he also shows to be MAXSNP-hard.Asahiro et al. (2012) investigated a version where a penalty function on the violated degree-bounds is to be minimized.They found that the problem is solvable in polynomial time if the penalty function is convex, but APX-hard in case of concave penalty functions.
Orientations of planar graphs Orientations of planar graphs received special attention by the research community because they reveal several interesting properties.Based on the insight that every planar graph allows for an orientation with maximum indegree 3, (Chrobak and Eppstein 1991) designed a highly efficient data structure for adjacency queries in planar graphs.In a distinct line of research, (Felsner 2004) showed that the set of orientations fulfilling a prescribed in-degree in a planar graph carries the structure of a distributive lattice.

Graph orientation and network flows
Graph orientation is connected to network flow theory both from a structural point of view as well as in the context of applications, e.g., in evacuation planning (Wolshon 2001) and traffic management (Hausknecht et al. 2011), where certain arcs of the network may be reversed in order to enable faster evacuation or to resolve traffic jams; see also the recent complexity results by Rebennack et al. (2010) and Arulselvan et al. (2014).In the next section, we will make use of the well-known fact that the fixed-degree orientation problem is equivalent to the maximum flow problem with unit capacities.This in particular implies that the problem can be solved in time O(|E| 3 2 ) using the classic algorithm by Dinic (1970).In the case of planar graphs, this further improves to a time of O(|E| log 3 |E|) using the recently developed multiple-source multiple-sink maximum flow algorithm by Borradaile et al. (2011).

Orientations with fixed in-degrees
We consider the problem of finding an orientation that meets given fixed in-degrees for both the vertices and faces of the embedded graph, called the fixed-degree primal-dual orientation problem.

Problem: Fixed-degree primal-dual orientation problem
Input: Task: or prove that there is no such orientation.
Remark 1 Note that we can assume the graph to be connected without loss of generality.First observe that we can assume v∈C α(v) = |E[C]| for each connected component C of G, as otherwise there is no feasible orientation.Now let v, w ∈ V be two vertices in different connected components that are both adjacent to a common face f .Connect v and w by introducing a new edge e .Note that this does not create a new face as the components were disconnected and hence no cycle was closed in the primal graph.Therefore, e corresponds to a loop at f in the dual graph.Now increase α(w) and α * ( f ) by 1.As v∈C α(v) = |E[C]| for each connected component C in the original graph, e has to be oriented from v to w in any feasible orientation of the modified graph, equalizing the added in-degree requirements at w and f .The modified graph, which has one connected component less, therefore has a feasible orientation if and only if there was a feasible orientation in the original graph.We apply this modification inductively until the graph is connected.

Primal and dual feasibility
The following notation will be useful throughout the proofs in this section.Given an instance of the fixed-degree primal-dual orientation problem, we say an orientation D is totally feasible if it is primally and dually feasible.
The fixed-degree primal-dual orientation problem thus asks for a totally feasible orientation.It is clear that the existence of both a primally feasible orientation and a dually feasible orientation is necessary for the existence of a totally feasible orientation.However, it can easily be checked that this is not sufficient and that it might be impossible to obtain primal and dual feasibility simultaneously by the same orientation.
Example 2 Consider a planar graph with two vertices and two parallel edges connecting them, i.e., a cycle of length two.Let α(v) = 1 and α * ( f ) = 1 for all v ∈ V and f ∈ V * .While orienting both edges in opposite directions in the primal graph is primally feasible, orienting them in the same direction-which corresponds to orienting them in oposite directions in the dual graph-is dually feasible.However, neither of the orientations is totally feasible.
We now present two distinct approaches for obtaining necessary and sufficient conditions for the existence of a totally feasible orientation.

A combinatorial approach for planar embeddings
Using the duality of cycles and cuts in planar graphs yields a combinatorial proof for the uniqueness of a feasible solution to the fixed-degree primal-dual orientation problem in the case of planar embeddings.We will also show how to construct a totally feasible solution from an orientation that is feasible in the primal graph and an orientation that is feasible in the dual graph.

Rigid edges
Observe that each edge in E[S] contributes 1 to the in-degree of a vertex in S, no matter how it is oriented, and thus all edges on the cut induced by S must be oriented from S to V \ S in all primally feasible orientations.We call edges whose orientation is fixed in this way primally rigid4 and denote the set of all primally rigid edges by R. Analogously, we define the set of dually rigid edges R * as those that are fixed for all dually feasible orientations due to a tight set S * ⊆ V * of faces with f ∈S * α * ( f ) = |E[S * ]|.We will use the following characterization of rigid edges by Felsner (2004), which we prove for completeness.
Lemma 3 An edge is primally rigid (dually rigid, respectively) if and only if it is on a directed cut in the primal graph (dual graph) with respect to any primally feasible (dually feasible) orientation.
Proof Let D be any primally feasible orientation and let S ⊂ V .Note that the fea- In other words, the vertex sets that define primally rigid edges are exactly those that induce directed cuts in G with respect to primally feasible orientations.The statement for dually rigid edges follows analogously.
Our main result in this section follows from this characterization of rigid edges and the duality of cycles and cuts in planar graphs.
Theorem 4 In case of a planar embedding, there exists a totally feasible orientation if and only if the following three conditions are fulfilled.If it exists, the solution is unique.
Proof The sufficiency of the conditions is trivial, as the third condition requires the existence of a totally feasible orientation.
In order to show necessity, assume there exists a totally feasible orientation D 0 .As D 0 is both primally and dually feasible, it fulfills condition (1) of the theorem.An edge is primally rigid if and only if it is on a directed cut with respect to D 0 in the primal graph.It is dually rigid if and only if it is on a directed cut in the dual graph.Thus, by cycle/cut duality of planar graphs, an edge is dually rigid if and only if it is on a directed cycle in the primal graph.As every edge in the primal graph is either on a directed cut or on a directed cycle, the sets of primally and dually rigid edges comprise a partition of E, proving condition (2).Now, let D be a primally feasible orientation and D * be a dually feasible orientation.As D 0 equals D on all primally rigid edges and equals D * on all dually rigid edges, the construction described in condition (3) yields D 0 and is feasible.
As all edges are either primally or dually rigid, they must have the same orientation in all totally feasible solutions, and D 0 is unique.
Note that the totally feasible solution constructed in the third condition does not depend on the choice of D and D * .As primally and dually feasible solutions can be found in polynomial time, and rigid edges can be identified by determining the strongly connected components with respect to D and D * , respectively, Theorem 4 yields a polynomial time algorithm for solving the problem for planar embeddings.

Corollary 5 The fixed-degree primal-dual orientation problem for planar embeddings can be solved in time O(|E| log 3 |E|).
Proof By Theorem 4, the problem can be solved by computing a primally feasible solution and a dually feasible solution and identifying the corresponding rigid edges.Let D be an arbitrary orientation of G and let (V, A) be the resulting digraph.Define A is a flow fulfilling the supplies/demands specified by b if and only if reversing all arcs a with x(a) = 1 results in a primally feasible orientation.We can verify the existence of such a vector x by computing a maximum S-T -flow from the sources S := {s ∈ V : b(s) > 0} to the sinks T := {t ∈ V : b(t) < 0}, where the net outflow of each source s ∈ S is bounded by b(s), the net inflow of each sink t ∈ T is bounded by |b(t)|, and the flow on each arc is bounded by 1.In planar graphs, such a flow, if it exists, can be computed in time O(|E| log 3 |E|) using the multiple-source multiple-sink planar maximum flow algorithm of Borradaile et al. (2011).The same procedure can be applied in the dual graph to find a dually feasible orientation.Finally, note that finding all rigid edges corresponds to identifying directed cuts, which is equivalent to identifying strongly connected components and can be done in time O(|E|) using depth-first search (Tarjan 1972).

A linear algebra analysis for general embeddings
We now generalize the results from the preceding section to more general embeddings by giving a tight bound on the number of totally feasible orientations depending on the genus of the embedding.To this end, we reformulate the fixed-degree primal-dual orientation problem as a system of linear equalities over binary variables.First, we fix an arbitrary orientation D of the graph and let (V, A) denote the resulting directed graph.We then introduce for every arc a ∈ A a decision variable x(a) that determines whether the orientation of the arc should be reversed (if it is 1) or not (if it is 0) in order to become totally feasible.Note that after such a reorientation, the in-degree of x(a).Therefore, the vector x ∈ {0, 1} A yields a feasible orientation if and only if it satisfies the following system of equalities: The matrix corresponding to the equalities (1) is the incidence matrix of the primal graph, while the matrix corresponding to the equalities (2) is the incidence matrix of the dual graph.As we assume the graph to be connected, we know that the rank of the former matrix is |V | − 1, while the rank of the latter matrix is |V * | − 1.Using the fact that the boundary of a face is a closed walk in the primal graph, it is easy to see that the rows of the first matrix are orthogonal to the rows of the second matrix.This implies that all feasible solutions are contained in a subspace of R Theorem 6 There are at most 2 2g distinct solutions to the fixed-degree primal-dual orientation problem.The set of all totally feasible orientations can be determined in time O(2 2g |E| 2 + |E| 3 ).The bound on the number of orientations is tight, i.e., for every g there is an embedded graph of genus g that allows for 2 2g distinct orientations.
Proof By basis augmentation, there is a set A ⊆ A of 2g arcs such that adding the equalities x(a) = b(a) with b(a) ∈ {0, 1} for all a ∈ A to the system (1) and ( 2) results in a system with full rank, i.e., it has at most one solution.If for some b ∈ {0, 1} A the unique solution exists and is a 0-1-vector, it corresponds to the unique totally feasible orientation that orients the edges of A according to the values b(a).Otherwise, there is no such totally feasible orientation.Thus, solving the equality system for all |{0, 1} A | = 2 2g possible values of b yields all possible solutions to the fixed-degree primal-dual orientation problem.This takes time O(|E| 3 ) for inverting the |E| × |E|-matrix and O(2 2g |E| 2 ) for multiplying the 2 2g distinct right hand side vectors.
To see that the bound on the number of orientations is tight, consider the example depicted in Fig. 2. The example is constructed from a base graph consisting of a cycle of length 3 with vertices a, b, c and an additional loop at vertex c.The base graph is embedded in a torus, thus featuring only a single face f .When setting α * ( f ) = |E| = 4, any orientation is dually feasible as all dual edges are loops.We set the in-degree specifications to α(a) = α(b) = 1 and α(c) = 2. Now, an orientation of the base graph is primally feasible if and only if the edges of the cycle are all oriented in the same direction.As the cycle and the loop can be oriented independently, the base graph has 4 feasible orientations.
Examples of higher genus can be obtained by introducing g copies of the embedding described above.The graphs are joined via an edge from vertex b i to a i+1 for every i ∈ {1, . . ., g − 1}.The resulting embedding has 3g vertices and 5g − 1 edges, and it still has only a single face.We increase the in-degree specifications of each base graph by setting α(a i+1 ) = 2 for i ∈ {1, . . ., g − 1}, so that the new edges joining the copies have to be oriented from copy i to copy i + 1.The in-degree specification of the face is set to |E| = 5g − 1.Now each copy of the base graph still has its 4 feasible orientations, so in total there are 4 g feasible orientations.

Orientations with upper and lower bounds
A generalization of the fixed-degree primal-dual orientation problem asks for an orientation that fulfills upper and lower bounds on the in-degrees of vertices and faces instead of attaining fixed values.We show that this problem is NP-complete, even when restricted to instances with embeddings of a fixed genus as, e.g., planar embeddings.

Problem: Degree-constrained primal-dual orientation problem
Input: Task: or prove that there is no such orientation.
In order to show the NP-completeness of the problem, we use a reduction from planar 3-SAT, which was shown to be NP-complete by Lichtenstein (1982).

Input:
A set of n variables V = {v 1 . . ., v n } and a set of m clauses C = {C 1 , . . ., C m }, each containing exactly three literals over V , such that the bipartite graph Task: Find a truth assignment for the variables in V such that all clauses in C are satisfied.

Theorem 7
The degree-constrained primal-dual orientation problem is NP-complete, even when restricted to embeddings with a fixed genus.
Fig. 3 Illustration of the variable gadget for a variable v i , which has d i occurrences in clauses.The gadget admits only the depicted orientations, the one on the left is interpreted as v i being 'true' and the other as v i being 'false' Proof An orientation that solves the degree-constrained primal-dual orientation problem can easily be verified in polynomial time.Hence, it remains to show that the problem is NP-hard.It is sufficient to do this for planar graphs.We use a reduction from planar 3-SAT.In the following, we let G 3SAT denote a fixed embedding of the planar graph corresponding to a given instance of planar 3-SAT.We proceed to construct an instance (G, α, β, α * , β * ) of the degree-constrained primal-dual orientation problem that has a solution if and only if the instance of planar 3-SAT has a solution.The construction consists of three parts: a variable gadget for each variable in G 3SAT , a clause gadget for each clause in G 3SAT , and an edge gadget for each edge in G 3SAT , connecting a clause and a variable gadget.
For each variable v i of degree , we introduce a variable gadget; see Fig. 3 for a depiction.The gadget consists of a cycle of length 2d i , and we refer to the vertices in this cycle as , and v d i ,F i .The cycle induces a single face which we call f i .We set degree bounds α * ( f i ) = 0 and β * ( f i ) = 2d i for this face.Note that any orientation fulfills the bounds imposed by face f i and we can therefore ignore the corresponding constraint.For now, in order to understand the idea behind the variable gadget, we set α(v) = β(v) = 1 for every v ∈ {v 1,T i , . . ., v d i ,F i }, but we will change this when extending the construction later.Let us analyze the construction so far.Since every vertex requires an in-degree of exactly 1, all edges of the cycle need be oriented the same with respect to f i , i.e., only two orientations of the gadget are permitted.We interpret each of the two possible orientations as a truth assignment for the variable v i , depending on the direction of the edges between v k,T i and v k,F i for k ∈ {1, . . ., d i }.Directing the edge towards v k,T i is interpreted as setting v i to 'true', and directing it towards v k,F i is interpreted as setting v i to 'false'.
For each clause C j in G 3SAT we introduce a clause gadget that is a cycle with nine vertices c 1 j , c 1,F j , c 1,T j , c 2 j , c 2,F j , c 2,T j , c 3 j , c 3,F j , c 3,T j enclosing a face F j ; see Fig. 4 for a depiction.We set α(c j ) = β(c j ) = 2 for ∈ {1, . . ., 3} and set α * (F j ) = 4 and β * (F j ) = 6.We set the lower and upper bounds for the remaining vertices to 1, and we remark that there will be one additional edge incident to each of these vertices in the final construction.For now, observe that any valid orientation has to direct the edges Fig. 4 Illustration of the clause gadget for a clause C j .All directed edges are rigid, and the orientation of each of the three remaining edges represents a truth assignment to a literal of the clause.At least one of these three edges needs to be oriented counter-clockwise with respect to F j .The dashed edges belong to edge gadgets connected to the clause gadget [4,6] incident to c 1 j , c 2 j , c 3 j towards these vertices.Each of the three remaining edges can be oriented either way, provided that at least one is in counter-clockwise orientation relative to the face F j .For each ∈ {1, . . ., 3}, the edge between c ,F j and c ,T j will determine whether the corresponding literal of C j is false or true.If it is directed from c ,T j to c ,F j , the corresponding literal is considered 'false', otherwise it is considered 'true'.In these terms, our construction enforces that at least one literal of C j has to be 'true'.
So far, we have provided a construction for each variable that can be oriented in two ways only, and we have given an interpretation of this orientation as a truth assignment to the variable.Also, we have provided a construction for each clause together with an interpretation of each valid orientation as a truth assignment to the literals of the clause.It remains to show how to connect the two constructions in a way that guarantees consistency of the truth assignments to variables and literals.To this end, we introduce an edge gadget for each edge e i j = {v i , C j } in G 3SAT between variable v i and clause C j as follows; see Fig. 5 for an illustration.We assume a fixed counter-clockwise ordering of the edges at each vertex in the embedding of G 3SAT .Suppose that e i j is the k-th edge at v i and the -th edge at C j with respect to this ordering.We introduce an additional edge between v k,T i and v k,F i and set α * ( f ) = β * ( f ) = 1 for the new face f enclosed by the two parallel edges.We reassign α Note that this construction ensures that the two parallel edges between v k,T i and v k,F i are both oriented towards the same vertex, and thus the whole variable gadget still has to be oriented as a directed cycle.The remaining construction depends on whether v i appears in a positive or negative literal in C j .If v i appears in a positive literal, we add two vertices w 1 i j , w 2 i j connected by two parallel edges with α * ( f ) = β * ( f ) = 1 for the induced face f .We add the edges {v k,F i , w 1 i j }, {w 1 i j , c ,F j }, {v k,T i , w 2 i j }, and {w 2 i j , c ,T j }, which yields two additional faces f 1 , f 2 .We set α(w Fig. 5 Illustration of the edge gadget for an edge connecting variable v i with clause C j .The gadget on the left is used when v i appears in a positive literal in C j , and the one on the right is used when v i appears in a negative literal.In both cases, the orientation of the edges in the variable gadgets induces an orientation of the edge in the clause gadget that corresponds to the value of the literal tation, the edge {c ,F j , c ,T j } is directed towards c ,T j (i.e., the corresponding literal is 'true') if and only if v i is 'true'.Now, if v i appears in a negative literal, we instead simply add the two edges {v k,F i , c ,F j }, {v k,T i , c ,T j }.This yields an additional face f , for which we set α * ( f ) = 0, β * ( f ) = 4. Observe that in any valid orientation, the edge {c ,F j , c ,T j } is directed towards c ,T j (i.e., the corresponding literal is 'true') if and only if v i is 'false'.Fig. 6 shows an example of the complete construction for a 3-SAT instance.
The construction described above admits an orientation if and only if the corresponding instance of planar 3-SAT admits a satisfying truth assignment.If it exists, the truth assignment can easily be inferred from the orientation by the interpretation given above.Finally, the construction can be made in polynomial time, which concludes our reduction.

Corollary 8
The degree-constrained primal-dual orientation problem is NP-complete even when restricted to instances with either α = β or α * = β * .Proof The corollary follows from the fact that the construction in the proof of Theorem 7 fulfills α = β.By duality, the reduction can also be achieved by an instance with α * = β * .

Conclusion
In this paper, we have studied orientation problems in embedded graphs with constraints on the in-degrees both in the primal graph and in the dual graph.Using the The depicted orientation corresponds to the assignment setting v 1 , v 2 , and v 4 to 'true' and setting v 3 to 'false' orthogonality of cycles and cuts, we have shown that the fixed-degree primal-dual orientation problem for embedded graphs of genus g has at most 2 2g feasible solutions and that the set of all solutions can be computed in time O(2 2g |E| 2 + |E| 3 ).In particular, the solution is unique if the embedding is planar, which answers the question by Frank that motivated our study.However, the problem becomes NP-complete immediately, even in the planar case, if only upper and lower bounds on the in-degrees are specified.
Although our results give an almost complete characterization of the complexity of the primal-dual orientation problem, a few interesting open questions remain.The running time of our algorithm for the fixed-degree primal-dual orientation problem is exponential in the genus of the embedding.It is open whether it is possible to devise an algorithm that finds a totally feasible orientation in time polynomial in the genus of the embedding.Furthermore, while we showed the degree-constrained primal-dual orientation problem to be NP-complete, even when restricted to instances where all vertices require a fixed in-degree and only the faces allow for intervals of different degrees, the complexity of the following special case, suggested by Woeginger 5 , remains unclear: Consider only instances where for each vertex v ∈ V either α(v) = 0 or β(v) = |δ(v)|, and for each face f ∈ V * either α * ( f ) = 0 or β * ( f ) = |δ( f )|.Both constructing a reduction from an NP-hard problem or devising an exact polynomial algorithm appears to be challenging in this case, as the one-sidedness of the bounds leaves a very wide degree of freedom.

Fig. 1
Fig. 1 Induced orientations of the edges in the dual graph.Primal edges are drawn as solid lines, dual edges are drawn as dashed lines.An edge in the dual graph crosses its corresponding edge in the primal graph from right to left

( 1 )
There exists both a primally feasible orientation D and a dually feasible orientation D * .(2) The edge set can be partitioned into primally rigid edges and dually rigid edges, i.e., E = R ∪ R * .(3) The orientation obtained by orienting all primally rigid edges in the same direction as they are oriented in D and all dually rigid edges in the same orientation as they are oriented in D * is totally feasible.

Fig.
Fig. Construction of an instance with 2 2g feasible orientations, showing the tightness of the bound in Theorem 6.The base graph consists of two cycles of length 3 intersecting in a common vertex and is embedded in a torus.Examples of genus g are obtained by introducing g copies of the base graph