Graph Orientations Optimizing the Number of Light or Heavy Vertices

This paper introduces four graph orientation problems named Maximize W -Light, Minimize W -Light, Maximize W -Heavy, and Minimize W -Heavy, where W can be any fixed non-negative integer. In each problem, the input is an undirected, unweighted graph G and the objective is to assign a direction to every edge in G so that the number of vertices with outdegree at most W or at least W in the resulting directed graph is maximized or minimized. A number of results on the computational complexity and polynomial-time approximability of these problems for different values of W and various special classes of graphs are derived. In particular, it is shown that Maximize 0-Light and Minimize 1-Heavy are identical to Maximum Independent Set and Minimum Vertex Cover, respectively, so by allowing the value of W to vary, we obtain a new generalization of the two latter problems. Submitted: May 2014 Reviewed: July 2015 Revised: August 2015 Accepted: September 2015 Final: September 2015 Published: October 2015 Article type: Regular paper Communicated by: K. Kawarabayashi A preliminary version of this article appeared in Proceedings of the 2 International Symposium on Combinatorial Optimization (ISCO 2012), volume 7422 of Lecture Notes in Computer Science, pp. 332–343, Springer-Verlag Berlin Heidelberg, 2012. This research was funded by KAKENHI grant numbers 23500020, 25330018, 26330017, and 26540005 and The Hakubi Project at Kyoto University. E-mail addresses: asahiro@is.kyusan-u.ac.jp (Yuichi Asahiro) jj@kuicr.kyoto-u.ac.jp (Jesper Jansson) miyano@ces.kyutech.ac.jp (Eiji Miyano) hirotaka@econ.kyushu-u.ac.jp (Hirotaka Ono) 442 Asahiro et al. Graph Orientations Optimizing Light or Heavy Vertices


Introduction
Two well-studied computational problems in theoretical computer science are Maximum Independent Set and Minimum Vertex Cover.In these two problems, the input is an undirected graph G = (V, E), and the objectives are to find a largest possible subset V ′ of V such that no two vertices in V ′ are adjacent in G (Maximum Independent Set) and a smallest possible subset V ′ of V such that every edge in E is incident to at least one vertex in V ′ (Minimum Vertex Cover).They were among the first problems ever to be shown to be NP-hard 1 , and were used as a starting point for proving the NP-hardness of countless other problems during the 1970s [22] and onwards.In recent years, they have been central to the development of three important subfields of computational complexity: polynomial-time approximation algorithms, hardness of approximation, and parameterized complexity.
A relatively less researched area is the computational complexity of graph orientation problems. 2By an orientation of an undirected graph G, we mean an assignment of a direction to each one of its edges.A graph orientation problem takes an undirected graph G as input and asks for an orientation of G that optimizes some well-defined criterion on the resulting directed graph, typically involving connectivity between vertices, the diameter, acyclicity, or constraints on the vertices' indegrees and/or outdegrees.
In this paper, we connect the concepts of Maximum Independent Set / Minimum Vertex Cover and graph orientation.We introduce four closely related graph orientation problems called Maximize W -Light, Minimize W -Light, Maximize W -Heavy, and Minimize W -Heavy, where W can be any fixed non-negative integer, and study their computational complexity and polynomial-time approximability for different values of W and different graph classes.Significantly, we demonstrate that Maximum Independent Set and Minimum Vertex Cover can be viewed as special cases of these graph orientation problems.Thus, by varying the parameter W , a new generalization of Maximum Independent Set and Minimum Vertex Cover is obtained.

Definitions
Let G = (V, E) be an undirected, unweighted graph with a vertex set V and an edge set E. An orientation Λ of G is a function that maps each undirected edge {u, v} in E to one of the two possible directed edges (u, v) and (v, u).Applying Λ to all edges in E transforms G into a directed graph, which we denote by Λ(G).See Figure 1 for an example.For convenience, we write Λ(E) = e∈E {Λ(e)} to refer to the set of directed edges in Λ(G).

G
Λ(G) Next, for any vertex u ∈ V , define the outdegree of u under Λ as d + Λ (u) = |{v : (u, v) ∈ Λ(E)}|, i.e., the number of outgoing edges from u in the directed graph Λ(G).For any non-negative integer W , a vertex u ∈ V is said to be W -light in Λ(G) if d + Λ (u) ≤ W , and W -heavy in Λ(G) if d + Λ (u) ≥ W .We now define four graph orientation problems that we call Maximize W -Light, Minimize W -Light, Maximize W -Heavy, and Minimize W -Heavy.
In each problem, W is a fixed non-negative integer, the input is an undirected graph G = (V, E) and the output is an orientation Λ of G such that: the number of W -light vertices in Λ(G) is maximized.
• Minimize W -Light: the number of W -light vertices in Λ(G) is minimized.
• Maximize W -Heavy: the number of W -heavy vertices in Λ(G) is maximized.
• Minimize W -Heavy: the number of W -heavy vertices in Λ(G) is minimized.
Throughout the paper, we define n = |V | and m = |E|.For any instance of Maximize W -Light or Minimize W -Light, let OP T (G) denote the number of W -light vertices in an optimal solution, and for any instance of Maximize W -Heavy or Minimize W -Heavy, let OP T (G) denote the number of W -heavy vertices in an optimal solution.Without loss of generality, the input graph G is assumed to be connected.
Let A be an algorithm that takes as input an undirected graph G and outputs an orientation of G.We say that A is a σ-approximation algorithm for Maximize W -Light (resp.Maximize W -Heavy), or that A's approximation ratio is at most σ, if A(G) ≥ OP T (G) σ holds for every input graph G, where A(G) is the number of W -light (resp.W -heavy) vertices in the solution returned by A. Similarly, we say that A is a σ-approximation algorithm for Minimize W -Light (resp.Minimize W -Heavy), or that A's approximation ratio is at most σ, if A(G) ≤ σ • OP T (G) holds for every input graph G, where A(G) is the number of W -light (resp.W -heavy) vertices in the solution returned by A.
For any given graph G = (V, E), any orientation Λ of G, and any fixed nonnegative integer W , the vertex set V is partitioned into two disjoint subsets: the set of W -light vertices in Λ(G) and the set of (W + 1)-heavy vertices in Λ(G).Therefore, if A is an algorithm that solves Maximize W -Light exactly then A solves Minimize (W + 1)-Heavy exactly as well, and we say that for every fixed W ≥ 0, Maximize W -Light and Minimize (W + 1)-Heavy are supplementary problems.However, if A is a good approximation algorithm for Maximize W -Light, it does not automatically follow that A yields a good approximation algorithm for Minimize (W + 1)-Heavy.The relationship between Minimize W -Light and Maximize (W + 1)-Heavy is analogous. 3

New results and organization of the paper
We derive some basic results on the computational complexity of the new graph orientation problems and investigate their relations to various computationally easy and hard problems.See the tables in Figure 2 for a summary.The paper is organized as follows: • Section 2 considers Maximize W -Light and Minimize (W + 1)-Heavy.
We prove that the two problems coincide with Maximum Independent Set and Minimum Vertex Cover, respectively, when W = 0.Moreover, Section 2 shows that Maximize W -Light and Minimize (W + 1)-Heavy are NP-hard for every fixed W ≥ 1, and explains how to approximate the former for any W ≥ 1 and the latter for W = 1 in polynomial time for any graph G and how to solve them exactly in linear time for any W ≥ 1 when G is a tree.
• Section 3 is devoted to Minimize W -Light and Maximize (W + 1)-Heavy.We show that when W = 0, the problems can be solved exactly in linear time for all classes of graphs.For unbounded W , they can be solved in quadratic time when restricted to outerplanar graphs and in linear time when restricted to trees.On the other hand, the problems become NP-hard for every fixed W ≥ 2, even if restricted to planar graphs.
In the general graph case, for any W ≥ 1, we can approximate Minimize W -Light within a ratio of (W + 1) in polynomial time with a maximum flow-based technique, and Maximize (W + 1)-Heavy within a ratio of (W + 2) in linear time with a greedy algorithm.
3 Pairs of supplementary problems whose polynomial-time approximability properties differ greatly can be found in the literature.For example, Maximum Independent Set and Minimum Vertex Cover are supplementary problems, and it is known that Maximum Independent Set is NP-hard to approximate within a ratio of n ǫ for any constant 0 ≤ ǫ < 1 [39], while Minimum Vertex Cover can be approximated within a ratio of 2 − Θ( and O(m)-time (W + 2)-approx.for unrestricted graphs (Theorem 10) W ≥ 2 NP-hard even for planar NP-hard even for planar graphs (Theorem 9) graphs (Theorem 9) Figure 2: Summary of the results described in this paper.The omitted problem variant Minimize 0-Heavy is trivial because all vertices have outdegree ≥ 0 under every orientation of G, i.e., OP T (G) = n always holds and any arbitrary orientation of the edges gives an optimal solution.In the same way, Maximize 0-Heavy is trivial with OP T (G) = n.

Motivation
The main reason for introducing the above problems is that they provide a natural extension of the well-known Maximum Independent Set and Minimum Vertex Cover problems.By studying the computational complexity of the new problems as W varies, one may gain novel insights into the structure of Maximum Independent Set and Minimum Vertex Cover.For example, the original Minimum Vertex Cover problem, i.e., Minimize (W +1)-Heavy with W = 0 according to Theorem 1 below, is NP-hard even if restricted to planar graphs [22].By Corollary 1, it becomes solvable in polynomial time for planar graphs when W ≥ 3.In contrast, Theorem 3 shows that increasing W does not decrease the computational complexity for unrestricted (non-planar) graphs.
An application of graph orientation problems in general is load balancing for parallel machine scheduling, where some "jobs" (corresponding to edges in G) have to be distributed among "machines" (corresponding to vertices in G) in a fair way [1,3,16], and each job must be handled by one of two specified machines.As an example, the problem of computing an orientation of G that minimizes the maximum outdegree was studied in [3,4,16,38]; in the context of efficient data structures, if G is a sparse graph then an orientation of G that minimizes the maximum outdegree can be employed to support fast (in the worst case) vertex adjacency queries in G when using adjacency lists [9,11].As another example, a graph orientation of G that maximizes the minimum outdegree [1] solves a special case of the Santa Claus problem [7] in which Santa Claus has to distribute a set of gifts (corresponding to edges in G) among a set of children (corresponding to vertices in G), each gift is of value to exactly two children, and the objective is to make the least lucky child as happy as possible.The new problems Maximize W -Light and Minimize (W + 1)-Heavy introduced in this paper can be regarded as load balancing problems where every machine initially has a capacity of W and we wish to find a job assignment that requires as few machines as possible to be upgraded to "supermachines" with unlimited capacity.As for Minimize W -Light and Maximize (W +1)-Heavy, these correspond to a version of the Santa Claus problem where each gift can be given to one of two specified children, a child is "happy" if he / she receives at least W + 1 gifts, and one wants to maximize the number of happy kids.

Related work
We note that the algorithm in Section 4.2 of [4] computes an orientation Λ of G that minimizes max{d + Λ (u) : u ∈ V }, taken over all possible orientations of G, in O(m 3/2 • log ∆) time, where ∆ is at most the maximum (unweighted) degree among all vertices in G. Using this algorithm, we can find an orientation of G under which all vertices are W -light, for any given W , when such an orientation exists.However, when such an orientation does not exist, the algorithm does not directly give a suitable solution for Maximize W -Light. Intuitively, in some instances of Maximize W -Light, it is better to "sacrifice" one vertex by giving it a high outdegree.As an example, let G be a star graph and W = 0. Orienting every edge towards the center vertex minimizes max{d + Λ (u) : u ∈ V }, but gives a very poor solution for Maximize 0-Light.Nevertheless, we will make use of this algorithm in Section 2.4 below to approximate Maximize W -Light.
Similarly, Algorithm Exact-1-MaxMinO in Section 3 of [1] computes an orientation Λ of G maximizing min{d + Λ (u) : u ∈ V }, taken over all orientations of G, in O(m 3/2 • log m • (log ∆) 2 ) time.By running Exact-1-MaxMinO, it is trivial to construct an orientation of G in which all vertices are W -heavy, for any given W , when one exists.
Every planar graph has an orientation in which all vertices are 3-light [11,35], and Chrobak and Eppstein [11] gave two different linear-time algorithms for constructing such an orientation.Hence: Corollary 1 ( [11]) For any W ≥ 3, Maximize W -Light and Minimize (W + 1)-Heavy restricted to planar graphs can be solved in O(n) time.
Another pair of supplementary problems that generalize Maximum Independent Set and Minimum Vertex Cover when their parameter is allowed to vary are Maximum k-Dependent Set [14,27] (sometimes called Maximum co-(k + 1)-Plex [6,33]) and Bounded-Degree-k Vertex Deletion [10,18,32,34,36], where k is a fixed non-negative integer.The former problem is to find a largest possible subset V ′ of the vertices in the input graph G such that each vertex in V ′ is adjacent to at most k vertices in V ′ , and the latter is to find a smallest possible subset of the vertices in G whose removal transforms G into a graph of degree at most k.(Thus, Maximum Independent Set and Minimum Vertex Cover correspond to the special case k = 0.) Figure 3   For every W ≥ 1, the orientation in (b) has n vertices that are W -light and 0 vertices that are (W + 1)-heavy, so this is an optimal solution to Maximize W -Light and Minimize (W + 1)-Heavy.On the other hand, the optimal solutions to Maximum k-Dependent Set and Bounded-Degree-k Vertex Deletion indicated by circles and crosses, respectively, in (c) have cardinalities (k + 1) • j and j.
shows that these generalizations are different from Maximize W -Light and Minimize (W + 1)-Heavy.
A previously studied optimization problem related to partial graph orientation under degree constraints is: Given an undirected graph with specified upper bounds on the indegree and the outdegree of each vertex, orient as many edges as possible while complying with the degree constraints (i.e., some edges might be left unoriented in the solution).Gabow [20] showed that this problem is MAXSNP-hard and 4/3-approximable in polynomial time.

-Heavy
This section investigates the supplementary problems Maximize W -Light and Minimize (W + 1)-Heavy for different values of W .

W = 0
We first prove the following lemma: Lemma 1 Let G = (V, E) be an undirected graph.For any orientation Λ of G, the set of 0-light vertices in Λ(G) forms an independent set in G. Conversely, given any independent set I in G, there exists an orientation of G in which the vertices from I are 0-light.
Proof: =⇒) For any pair u, v of 0-light vertices in Λ(G), no edges in Λ(G) are oriented away from u or v by the definition of 0-light, so G cannot contain the edge {u, v}.Thus, the set of 0-light vertices forms an independent set in G. ⇐=) Define an orientation Λ of G as follows.First, for each u ∈ I, orient all edges involving u towards u.Next, orient all remaining edges arbitrarily.Obviously, every vertex from I will be 0-light in Λ(G).
As mentioned in Section 1.1, for any orientation Λ of G, the set of 0-light vertices in Λ(G) and the set of 1-heavy vertices in Λ(G) form a partition of V .Also, any subset Consequently, the known hardness results for Maximum Independent Set [39] and Minimum Vertex Cover [15] immediately carry over to Maximize 0-Light and Minimize 1-Heavy.On the positive side, we can apply existing approximation algorithms for Maximum Independent Set [17] and Minimum Vertex Cover [29].Furthermore, Maximum Independent Set and Minimum Vertex Cover can be solved in polynomial time for some classes of graphs such as bipartite graphs [24], and even in linear time for certain useful special classes of graphs such as chordal graphs4 [23].In summary, we have: • ( [39]) Maximize 0-Light cannot be approximated within a ratio of n ǫ for any constant 0 ≤ ǫ < 1 in polynomial time, unless P = NP.
• ( [15]) Minimize 1-Heavy cannot be approximated within a ratio of 1.3606 in polynomial time, unless P = NP.
• ( [24]) Maximize 0-Light and Minimize 1-Heavy restricted to bipartite graphs can be solved in polynomial time.
• ( [23]) Maximize 0-Light and Minimize 1-Heavy restricted to chordal graphs can be solved in linear time.

W ≥ 1, restriction to trees
When G is a tree, optimal solutions to the problems can be computed easily by applying an algorithm named Up-To-Roots in [3] that works as follows: Select any node r in G, root G in r, and orient every edge towards r.
Clearly, Up-To-Roots produces an orientation with exactly n − 1 vertices having outdegree 1 and one vertex having outdegree 0, which means that for any W ≥ 1, trivially, all n vertices are W -light and none are (W + 1)-heavy.This gives:  To prove the claim, first note that if G has an orientation with at least k vertices that are W -light, it is straightforward to extend it to an orientation of G ′ that makes at least k + (2W + 3) • |V | vertices (W + 1)-light by orienting, for every v i ∈ V : (i) the edge {v i , w i } as (v i , w i ); and (ii) the edges inside K i so that all of its 2W + 3 vertices get outdegree (W + 1) (for example, denote the vertices of K i by {u 0 , u 1 , . . ., u 2W +2 } and orient each edge {u j , u k } as (u j , u k ) if k − j (mod 2W + 3) ∈ {1, 2, . . ., W + 1} and as (u k , u j ) otherwise).Next, suppose that G ′ has an orientation in which at least k + (2W + 3) • |V | vertices are (W + 1)-light.For every v i ∈ V , if some vertex belonging to K i is not (W + 1)-light then orienting {v i , w i } and the edges of K i as in (i) and (ii) above yields an orientation Λ ′ of G ′ in which all vertices in V ′ \ V are (W + 1)-light while not decreasing the total number of (W + 1)-light vertices.At least k vertices in V are (W + 1)-light in Λ ′ and for each such v i , the edge {v i , w i } is oriented as (v i , w i ).Thus, taking the restriction of Λ ′ to the original G gives an orientation of G in which at least k vertices are W -light.

W ≥ 1, approximation algorithms
To approximate Maximize W -Light for any fixed W ≥ 1 as well as Minimize 2-Heavy in polynomial time, we will apply some known results from the literature.
We first consider Maximize W -Light.To approximate it, we use the simple partitioning technique from Proposition 2.2 in [26] to get an ( n log n )approximation.It will be referred to as Algorithm Partition into subsets below.For clarity, the algorithm is shown explicitly in Figure 4. 1. Arbitrarily partition V into ⌊n/ log n⌋ sets V 1 , V 2 , ..., V ⌊n/ log n⌋ , each of size at most ⌈log n⌉ + 1. 2. For every subset V ′ i of every set V i , check if the subgraph of G induced by V ′ i has an orientation in which all vertices are W -light.Let Z be any such subset of maximum cardinality, and let Λ be the corresponding orientation of the subgraph of G induced by Z.  Proof: According to Steps 2 and 3, all vertices belonging to Z are guaranteed to be W -light in the resulting orientation of G.
To analyze the approximation ratio, we use the same argument as in the analysis of Proposition 2.2 in [26].Let Λ * be any optimal orientation of G and let Z * be the set of W -light vertices in Λ * .By the pigeonhole principle, at least one of the subsets V 1 , V 2 , ..., V ⌊n/ log n⌋ contains a fraction of 1 ⌊n/ log n⌋ or more of the elements in Z * .For any V ′ i ⊆ V , every vertex in V ′ i that is W -light in Λ * will still be W -light in the subgraph of G induced by V ′ i because its outdegree will not increase.Thus, the discovered ) because every V i has at most 2 log n+2 = O(n) subsets, and each such V ′ i can be tested in Step 2 to see if the subgraph of G induced by V ′ i admits an orientation that makes all vertices W -light in O(log 3 n log log n) time by the algorithm in Section 4.2 of [4], which computes an orientation Λ ′ of a given graph , where ∆ ′ is at most the maximum (unweighted) degree among all vertices in V ′ (here, . Next, we focus on the case W = 1.Recall the following definitions from the literature (see, e.g., [21]): A pseudotree is a connected, undirected graph containing exactly one cycle, and a pseudoforest is a union of vertex-disjoint trees and pseudotrees.Thus, every connected component of a pseudoforest has at most one cycle.For any subset V ′ ⊆ V of the vertices in a graph G = (V, E), V ′ induces the subgraph of G consisting of V ′ and all edges in E whose two endpoints belong to V ′ .An induced subgraph of G that is a pseudoforest and has the largest possible number of vertices is a maximum induced pseudoforest in G.The next lemma is analogous to Lemma 1: Lemma 3 Let G = (V, E) be an undirected graph.For any orientation Λ of G, the subgraph of G induced by the set of 1-light vertices in Λ(G) is a pseudoforest.Conversely, for any subset V ′ ⊆ V , if V ′ induces a pseudoforest in G then there exists an orientation of G in which the vertices from V ′ are 1-light.
Proof: =⇒) Let G ′ be the subgraph of G induced by the set of 1-light vertices in Λ(G).In every connected component X in G ′ , the number of edges is less than or equal to the number of vertices by the definition of a 1-light vertex, so if X is not a tree then X contains precisely one cycle.Therefore, each connected component in G ′ is either a tree or a pseudotree, and it follows that G ′ is a pseudoforest.
⇐=) Define an orientation Λ of G as follows.For each connected component X in the induced pseudoforest, if X is a tree then apply Up-To-Roots from Section 2.2 to X; otherwise, let C be the cycle in X, orient all edges of X not belonging to C towards C, and traverse C in either direction while orienting all its edges forward.Finally, orient every edge in G with exactly one endpoint in V ′ towards V ′ and orient all remaining edges of G arbitrarily.This way, every vertex in V ′ will be 1-light in Λ(G).Lemma 3 implies that the running time of Algorithm Partition into subsets can be improved slightly for the special case W = 1: Proof: Proceed as in the proof of Theorem 4, but implement Step 2 as follows.
To check if the subgraph of G induced by V ′ i has an orientation in which all vertices are W -light, check if by depth-first search instead of using the algorithm from [4].The total running time will be O( n More importantly, it also follows from Lemma 3, together with the fact that any given orientation of G partitions V into 1-light and 2-heavy vertices, that Minimize 2-Heavy is identical to the problem of finding a smallest cardinality subset of V whose removal leaves a pseudoforest.This is a special case of the more general "node-deletion problem for a graph property π" in [19], which asks for a minimum set of vertices whose deletion leaves a subgraph satisfying π; more precisely, it is the special case where π is the property "every connected component of a graph contains at most one cycle".By point (4) of Theorem 9 in [19], when restricted to this particular property, the output of the polynomial-time approximation algorithm in [19] is at most twice the cardinality of a minimum solution.Therefore: Proof: Let G = (V, E) be the input undirected graph.There are two cases: 1.If G is a tree then G has n vertices and n−1 edges, so at most n−1 vertices can be 1-heavy in any orientation of G. Run the algorithm Up-To-Roots mentioned in Section 2.2 to obtain an orientation of G with n − 1 1-heavy vertices, which is optimal, in O(n) = O(m) time.
2. If G is not a tree then first find a cycle C in G by depth-first search in O(m) time.Then, select an arbitrary edge e on C and orient it away from u, where u is either one of its endpoints.Compute any spanning tree T of G \ {e} in O(m) time, root T at the vertex u, and orient every edge of T towards the root.This ensures that every vertex of G gets outdegree at least 1, i.e., no vertex is 0-light and all vertices are 1-heavy in the resulting orientation of G. Finally, orient any remaining edges arbitrarily.

Polynomial-time solutions for special graphs
In this subsection, we allow W to be unbounded but restrict the input to certain graph classes.
We first present a linear-time solution for the case where the input G is a tree.The algorithm is listed in Figure 5.It is named Extended Up-To-Roots because when W = 0, it is the same as the algorithm Up-To-Roots of [3] described in Section 2.2 if we always select a leaf as the node r.
1. Root the tree G in any leaf r, and for every u ∈ V , initialize s(u) = 0. 2. For every non-root node u bottom-up order, do:

2.1
Let p be the parent of u.

2.2
If s(u) = W then orient the edge {u, p} from u to p.

2.3
Else, orient the edge {u, p} from p to u and let s(p) = s(p) + 1. .We shall prove that after u has been treated in Step 2 of the algorithm, the orientation obtained so far gives an optimal solution for Maximize (W + 1)-Heavy for G ∧ [u].By the bottom-up ordering of the nodes, we may assume inductively that this property holds for all children of u (if any).Two cases are possible: When W = 0, Step 2.2 makes u one of the (W + 1)-heavy vertices in the resulting orientation.
• u is an internal node: Let Λ be the orientation of G ∧ [u] constructed in Steps 2.2 and 2.3, and let C(u) be the set of children of u.By the induction hypothesis, it holds that for each Thus, the number of (W +1)-heavy vertices an optimal solution for G ) or more (W + 1)-heavy vertices since it is a tree.)If s(u) = W in Step 2.2, there are exactly W edges oriented from u to the children of u, and we make u a (W + 1)-heavy vertex by orienting the edge {u, p} towards p, so the obtained orientation of G ∧ [u] has 1 + ui∈C(u) OP T (G ∧ [u i ]) vertices that are (W +1)-heavy.On the other hand, if s(u) < W then u can not become (W + 1)-heavy and if s(u) > W then u is already (W + 1)-heavy; in both of these cases, G ∧ [u] is already optimally oriented, and we orient {u, p} away from p and increment s(p) in Step 2.3.
The running time is O(n + m) = O(n) because every node and every edge is considered once in the loop in Step 2 and because G is a tree.
Next, we turn to the case where G is an outerplanar or planar graph.We reduce Maximize W -Heavy to a problem named Maximum Q-Edge Packing, studied in, e.g., [28].The latter is defined as follows.Let Q be an undirected graph.The Maximum Q-Edge Packing problem takes as input an undirected graph H (called a "host graph") and asks for the maximum number of edge-disjoint isomorphic copies of Q in H. Now, given an instance G = (V, E) of Maximize W -Heavy with n vertices, construct an instance of Maximum K 1,(W +n) -Edge Packing, where K 1,(W +n) denotes the star graph consisting of one center vertex with W + n neighboring leaves.To do this, let H be a copy of the graph G, and for each v ∈ V , create n new vertices and attach them to v in H. See Figure 6 for an illustration.Thus, H contains n + n 2 vertices and O(n 2 ) edges.Then, we have the following: Lemma 4 For any positive integer x, the graph G has an orientation Λ such that Λ(G) contains at least x W -heavy vertices if and only if the graph H contains at least x edge-disjoint copies of K 1,(W +n) .

G:
H: By transforming G to H as explained above and then applying the algorithms from [28] for Maximum Q-Edge Packing, where Q is a star graph, we obtain: Theorem 8 • For any W ≥ 0, Minimize W -Light and Maximize (W + 1)-Heavy restricted to outerplanar graphs can be solved in O(n 2 ) time.
• For any W ≥ 0, Maximize (W + 1)-Heavy restricted to planar graphs has an O(n

W ≥ 2, NP-hardness
Theorem 3.1 in [28] proves that for every fixed W ≥ 2, Maximum K 1,(W +1) -Edge Packing is NP-hard, even if restricted to planar graphs.(Recall that K 1,(W +1) denotes the star graph with one center vertex and W + 1 leaves.)The reduction is from Planar 3-SAT.We observe that in the reduction, every vertex in the constructed graph H has degree strictly less than 2(W + 1).Therefore, any two copies of K 1,W +1 in H must use different center vertices, and it follows that any set of x edge-disjoint copies of the star graph K 1,(W +1) in H induces an orientation of H in which x vertices are (W + 1)-heavy, and vice versa.Hence, optimal solutions to the two problems Maximize (W + 1)-Heavy and Maximum K 1,(W +1) -Edge Packing for the constructed graph H are equivalent.We obtain: Theorem 9 For every fixed W ≥ 2, Minimize W -Light and Maximize (W + 1)-Heavy are NP-hard, even if restricted to planar graphs.
3.4 W ≥ 1, a greedy approximation algorithm for Maximize (W + 1)-Heavy 1. Repeat until all vertices have been considered exactly once: 1.1 Select any previously unconsidered vertex u.

1.2
If u has at least W +1 incident unoriented edges then orient any W +1 of them away from u.
2. Orient any remaining unoriented edges arbitrarily.Proof: Let Λ be the partial orientation on E defined after Step 1 of the algorithm, where "partial" means that we some edges in E to remain unoriented.Let Λ * be any optimal solution.Denote the set of (W + 1)-heavy vertices in Λ(G) by S and the set of (W + 1)-heavy vertices in Λ * (G) by S * .For any u in S, u takes an edge from at most (W + 1) vertices that belong to S * and therefore prevents at most (W + 1) of the vertices in S * from being (W + 1)-heavy in Λ(G).Denote the set of these vertices by S * u .Then, S * can be partitioned into u∈S S * u and S ∩ S * (this is because if there is a vertex in S * \ ( u∈S S * u ∪ (S ∩ S * )), it must be selected in Step 1.2 and thus be included in S ∩ S * , which would give a contradiction).Hence, the approximation ratio is: Step 1 is performed exactly n times, and each edge is considered at most two times in total, so the algorithm can be implemented to run in O(n + m) = O(m) time.
The approximation ratio (W + 2) in Theorem 10 is tight.See Figure 8.We remark that Theorem 5.1 in [28] describes an approximation algorithm for Maximum Q-Edge Packing which is based on a similar idea.However, we cannot apply it here directly because it assumes that Q is fixed; it identifies all copies of Q in H, so its running time depends exponentially on the size of Q.Let G = (V, E) be any input undirected graph to Minimize W -Light. Define a directed graph N G = (V G , E G ) with vertex set V G and edge set E G as shown in Figure 9 by setting: (Each vertex in N G that corresponds to a vertex v in G has outdegree deg(v) + W + 1, and each vertex in N G that corresponds to an edge in G has indegree 2.) Next, for any integer q ∈ {0, 1, . . ., n}, let N G (q) = (V G , E G , cap q ) be the Finally, we briefly discuss two techniques from the literature that could lead to stronger results for special cases of the new problems.
• Baker [5] presented a polynomial-time approximation scheme (i.e., a polynomial-time (1 + ǫ)-approximation algorithm for any fixed ǫ > 0) for Maximum Independent Set restricted to planar graphs.It first takes any planar embedding of the input graph G, partitions its vertices into successive layers V 1 , V 2 , V 3 , . . ., and defines a collection {G 1 , G 2 , . . ., G k } of k-outerplanar graphs, where k = ⌈1 + (1/ǫ)⌉, by removing the layers V i , V i+k , V i+2k , . . .from a copy of G to get each G i .It then runs an exact, polynomial-time algorithm for Maximum Independent Set restricted to k-outerplanar graphs on each G i , and returns the best solution found.For any optimal solution I, at least one graph G i contains at least k−1 k of the vertices in I, so this method is a ( k k−1 )-approximation, i.e., a (1 + ǫ)-approximation.Baker's technique can be applied to many other optimization problems on planar graphs (see [5]), and if one could develop an exact, polynomial-time algorithm for Maximize W -Light with W ∈ {1, 2} restricted to k-outerplanar graphs then the above analysis implies that this problem variant admits a polynomial-time approximation scheme for planar graphs as well.
• By formulating the problems in monadic second-order logic and applying Courcelle's theorem [13], one would obtain fixed-parameter tractable algorithms for graphs of bounded treewidth.Here, it is straightforward to come up with formulas of length O(1) that express the condition that every edge in G is oriented (e.g., first assign an arbitrary ordering to the vertices in G and partition the edges into two sets, consisting of all edges oriented from a vertex with a smaller index to a vertex with a larger index and vice versa, and ensure that each edge belongs to exactly one of them) and that tell us in which direction any specified edge is oriented in an orientation.The difficulty is defining a compact formula, i.e., whose length does not depend on the size of the graph, for checking if a vertex has at most / at least W outgoing edges.We leave it as an open problem to resolve this issue.

Figure 1 :
Figure 1: An example of an undirected graph G and an orientation Λ of G. Four vertices are 2-light and three vertices are 2-heavy in Λ(G).

Figure 3 :
Figure3: Let k ≥ 0 and j ≥ 1 be integers and let G be the tree in (a) obtained by attaching k + 1 leaves to each node on a path of length j.Then n = (k + 2) • j.For every W ≥ 1, the orientation in (b) has n vertices that are W -light and 0 vertices that are (W + 1)-heavy, so this is an optimal solution to Maximize W -Light and Minimize (W + 1)-Heavy.On the other hand, the optimal solutions to Maximum k-Dependent Set and Bounded-Degree-k Vertex Deletion indicated by circles and crosses, respectively, in (c) have cardinalities (k + 1) • j and j.

Theorem 1
Together with Lemma 1, this yields: Lemma 2 Let G = (V, E) be an undirected graph.For any orientation Λ of G, the set of 1-heavy vertices in Λ(G) forms a vertex cover of G. Conversely, given any vertex cover C of G, there exists an orientation of G in which the vertices from C are 1-heavy.Hence: Maximize 0-Light and Maximum Independent Set are identical, and Minimize 1-Heavy and Minimum Vertex Cover are identical.

Theorem 2
For any W ≥ 1, Maximize W -Light and Minimize (W + 1)-Heavy restricted to trees can be solved in O(n) time.

2. 3 WTheorem 3
≥ 1, NP-hardness By Corollary 2 above, Maximize W -Light and Minimize (W + 1)-Heavy are NP-hard when W = 0. We now show that the problems are also NP-hard for other values of W .For every fixed W ≥ 0, Maximize W -Light and Minimize (W + 1)-Heavy are NP-hard.Proof: We give a polynomial-time reduction from Maximize W -Light to Maximize (W + 1)-Light for any W ≥ 0. The theorem then follows from the NP-hardness of Maximize 0-Light, induction, and Maximize W -Light and Minimize (W + 1)-Heavy being supplementary.Let G = (V, E) be a given instance of Maximize W -Light. Construct an instance G ′ = (V ′ , E ′ ) of Maximize (W + 1)-Light by taking |V | copies of the complete graph K 2W +3 with 2W + 3 vertices and attaching one such copy K i to each v i ∈ V by adding an edge between v i and any one vertex w i in K i .We claim that G has an orientation in which at least k vertices are W -light if and only if G ′ has an orientation in which at least k + (2W + 3) • |V | vertices are (W + 1)-light.

3 .
Extend Λ to all of G by orienting all edges with exactly one endpoint in Z towards Z and orient all remaining edges of G arbitrarily.

Figure 5 :Theorem 7
Figure 5: Algorithm Extended Up-To-Roots for solving Minimize W -Light and Maximize (W + 1)-Heavy restricted to trees.

Figure 6 :
Figure 6: In the reduction from Maximize W -Heavy to Maximum K 1,(W +n) -Edge Packing, n new vertices are attached to each vertex in a copy of G to obtain the host graph H.

Figure 7
Figure 7 presents an approximation algorithm named Greedy Graph Orientation for Maximize (W + 1)-Heavy for general graphs.It runs in linear time.

Figure 8 :
Figure 8: A bad example for Algorithm Greedy Graph Orientation.(In the figure, W = 3.)Here OP T (G) = W + 2, but if the algorithm first selects vertex u and orients (W + 1) edges away from u as shown on the right, then only u can be (W + 1)-heavy in any resulting orientation.

3. 5 W
≥ 1, an approximation algorithm for Minimize W -Light Finally, we give a polynomial-time approximation algorithm for Minimize W -Light for any fixed W ≥ 1.It is based on computing maximum flows in a family of flow networks {N G (0), N G (1), . . ., N G (n)} with positive edge capacities.
[28]he given instance G of Minimize W -Light / Maximize (W + 1)-Heavy is an outerplanar graph then the constructed graph H is also outerplanar.According to Theorem 4.2 in [28], Maximum Q-Edge Packing restricted to outerplanar graphs can be solved in O(|V H |) time by dynamic programming, where |V H | is the number of vertices in H, when Q is any star graph with at least 3 leaves.By Lemma 4 above, setting Q = K 1,(W +1+n) and running the algorithm in Theorem 4.2 in [28] on H solves Minimize W -Light / Maximize (W + 1)-Heavy in O(n 2 ) time.In the more general case where G is a planar graph, H becomes planar, and we apply Theorem 5.3 in[28]instead, which says that Maximum Q-Edge Packing restricted to planar graphs admits an O(|E H |)-time 2-approximation algorithm when Q is a star graph with at least 3 leaves and where |E H | is the number of edges in H.