DOI 10.1007/s13173-012-0065-7 S I : G R A P H C L I Q U E S
Sandwich problems on orientations
Olivier Durand de Gevigney·Sulamita Klein· Viet-Hang Nguyen·Zoltán Szigeti
Received: 1 February 2012 / Accepted: 3 February 2012 / Published online: 28 February 2012 © The Brazilian Computer Society 2012
Abstract The graph sandwich problem for property is defined as follows: Given two graphs G1=(V , E1) and G2=(V , E2) such that E1⊆E2, is there a graph G= (V , E) such that E1⊆E ⊆E2 which satisfies property ? We propose to study sandwich problems for properties concerning orientations, such as Eulerian orientation of a mixed graph and orientation with given in-degrees of a graph. We present a characterization and a polynomial-time algorithm for solving them-orientation sandwich problem.
Keywords Sandwich problems·Orientation of graphs· Submodular flows
1 Introduction
Given two graphsG1=(V , E1)andG2=(V , E2)with the same vertex set V and E1⊆E2, a graph G=(V , E) is called asandwichgraph for the pairG1, G2ifE1⊆E⊆E2. The graph sandwich problem for property is defined as follows [12]:
O. Durand de Gevigney (
)·V.-H. Nguyen·Z. Szigeti Laboratoire G-SCOP, CNRS, Grenoble INP, UJF, 46, Avenue Félix Viallet, Grenoble 38000, Francee-mail:[email protected] V.-H. Nguyen
e-mail:[email protected] Z. Szigeti
e-mail:[email protected] S. Klein
Instituto de Matemática and COPPE, Universidade Federal do Rio de Janeiro, Rio de Janeiro, Brazil
e-mail:[email protected]
GRAPHSANDWICHPROBLEM FORPROPERTY
Instance: Given undirected graphsG1=(V , E1)andG2= (V , E2)withE1⊆E2.
Question: Is there a graphG=(V , E)such thatE1⊆E⊆ E2andGsatisfies property?
We callE1themandatoryedge set,E0=E2\E1the op-tionaledge set andE3theforbiddenedge set, whereE3 de-notes the set of edges of the complementary graphG2ofG2. Thus any sandwich graphG=(V , E)for the pairG1, G2 must contain all mandatory edges, no forbidden edges and may contain a subset of the optional edges. Graph sandwich problems have attracted much attention lately arising from many applications and as a natural generalization of recog-nition problems [1–3,7,22,24]. The recognition problem for a class of graphsC is equivalent to the graph sandwich problem in whichG1=G2=G, whereGis the graph we want to recognize and propertyis “to belong to classC”.
In this paper we propose to study sandwich problems for properties concerning orientations, such as Eulerian orientation of a mixed graph and orientation with given in-degrees of a graph, or more generally of a mixed graph.
In Sect.5we consider sandwich problems regarding anm -orientation, i.e., given undirected graphsG1=(V , E1)and G2=(V , E2)withE1⊆E2and a non-negative integer vec-tormonV, we show that it is polynomial to decide whether there exists a sandwich graphG=(V , E) (E1⊆E⊆E2) that has an orientationG whose in-degree vector ismthat isd−
G(v)=m(v)for allv∈V. This result stands in contrast to the strongly connected m-orientation sandwich problem which we show is NP-complete. Section6 is devoted to a new kind of sandwich problem where we may contract (and not delete) optional edges and propertyis being bipartite.
2 Definitions
Undirected graphs Let G = (V , E) be an undirected graph. For vertex setsX andY, the cutinduced byX is defined to be the set of edges ofGhaving exactly one end-vertex inX and is denoted byδG(X). ThedegreedG(X) (or dE(X)) ofX is the cardinality of the cut induced by X, that is, dG(X)= |δG(X)|. The number of edges be-tween X \Y and Y \X is denoted by dG(X,Y). The number of edges ofGhaving both (resp. at least one) end-vertices inXis denoted byiG(X)oriE(X)or simplyi(X) (resp.eG(X)). It is well-known that (1) is satisfied for all X, Y⊆V,
dG(X)+dG(Y )=dG(X∩Y )+dG(X∪Y )
+2dG(X, Y ). (1)
We say that a vectormonV is thedegree vectorofG if dG(v)=m(v)for all v∈V. For a vectorm on V, we considerm as amodular function, that is, we use the no-tationm(X)=v∈Xm(v). Let us recall thatdG(X)is the degree functionof G. We define dˆG as the modular func-tion defined by the degree vector dG(v) of G. Note that
ˆ
dG(X)=dG(X)+2iG(X)∀X⊆V.
We denote byTGthe set of vertices ofGof odd degree. For an edge setF ofG, the subgraph induced byF, that is, (V , F ), is denoted byG(F). We say thatGisEulerianif the degree of each vertex is even, that is, ifTG= ∅. Note that we do not suppose the graph to be connected.
LetT be a vertex set inG. An edge setF ofGis called T-joinif the set of odd degree vertices in the subgraph in-duced by F coincide with T, that is ifTG(F )=T. Given a cost vector on the edge set ofG, a minimum cost T-join can be found in polynomial time by Edmonds and Johnson’s algorithm [5].
Letf be a non-negative integer vector onV. An edge set F ofGis called anf-factorofGiff is the degree vector of G(F ), that is,dF(v)=f (v)for allv∈V. Iff (v)=1 for all v∈V, then we say thatF is a 1-factor or aperfect matching. Anf-factor—if it exists—can be found in polynomial time,
see [20]. The graphGis called 3-regularif each vertex is of degree 3. Note that for a 3-regular graph, the existence of two edge-disjoint perfect matchings is equivalent to the existence of three edge-disjoint perfect matchings which is equivalent to the 3-edge-colorability of the graph.
Directed graphs LetD=(V , A)be a directed graph. For a vertex setX, the set of arcs ofDentering (resp. leaving)X is denoted byD(X)(resp.δD(X)). Thein-degreed−D(X) (resp.out-degreed+D(X)) ofXis the number of arcs ofD entering (resp. leaving)X, that isdD−(X)= |D(X)|(resp. dD+(X)= |δD(X)|). The set of arcs ofGhaving both end-vertices inXis denoted byA(X). The following equality will be used frequently without reference:
dD−(X)−dD+(X)= v∈X
dD−(v)−dD+(v). (2)
We say that a vectormonV is thein-degree vectorofD ifdD−(v)=m(v)for allv∈V. Let us recall thatdD−(X)is thein-degree functionofD. Letf be a non-negative integer vector onV. An arc setF ofDis called adirectedf-factor ofDiff is the in-degree vector ofD(F ), that is,dF−(v)= f (v)for allv∈V.
We say thatDisEulerianif the in-degree ofv is equal to the out-degree ofvfor allv∈V, that is,dD−(v)=dD+(v) for allv∈V. Note that we do not suppose the graph to be connected.
Letf andgbe two vectors on the arcs ofD such that f (e)≤g(e)for alle∈A. A vectorx on the arcs ofDis a circulationif (3) and (4) are satisfied.
xδD(v)
=xD(v)
∀v∈V , (3)
f (e)≤x(e)≤g(e) ∀e∈A. (4)
Note that iff (e)=g(e)=1 for alle∈A, thenDis Eulerian if and only iff is a circulation. We will use the following characterization when a circulation exists.
Theorem 1(Hoffmann [15]) LetD=(V , A)be a directed graph and f and g two vectors on A such that f (e)≤ g(e)∀e∈A.There exists a circulation inDif and only if
fD(X)
≤gδD(X)
∀X⊆V . (5)
We say thatH=(V , E∪A)is amixed graphifEis an edge set andAis an arc set onV. For an undirected graph G=(V , E), if we replace each edgeuvby the arcuvorvu, then we get the directed graphG =(V ,E) . We say thatG is anorientationofG.
Theorem 2 (Ford, Fulkerson [8]) A mixed graph H = (V , E∪A)has an Eulerian orientation if and only if
dA−(v)+dA+(v)+dE(v) is even∀v∈V , (6) dA−(X)−dA+(X)≤dE(X) ∀X⊆V . (7) The following theorem characterizes graphs having an orientation with a given in-degree vector.
Theorem 3(Hakimi [13]) Given an undirected graphG= (V , E)and a non-negative integer vectormonV,there ex-ists an orientation G ofG whose in-degree vector ismif and only if
m(X)≥i(X) ∀X⊆V , (8)
m(V )= |E|. (9)
Functions Letbbe a set function on the subsets ofV. We say thatbissubmodularif for allX, Y⊆V,
b(X)+b(Y )≥b(X∩Y )+b(X∪Y ). (10) The functionbis calledsupermodularif−bis submodular. A function ismodularif it is supermodular and submodular. We will use frequently in this paper the following facts. Claim 1 The degree functiondG(Z)of an undirected graph Gand the in-degree functiondD−(Z)of a directed graphD
are submodular and the functioni(Z)is supermodular.
Theorem 4 [17,21] The minimum value of a submodular function can be found in polynomial time.
Theorem 5(Frank [9]) Letb andp be a submodular and a supermodular set function onV such that p(X)≤b(X)
for allX⊆V.Then there exists a modular functionmonV
such thatp(X)≤m(X)≤b(X)for allX⊆V.Ifband p
are integer valued thenmcan also be chosen integer valued.
A pair(p, b)of set functions on 2V is astrong pairifp (resp.b) is supermodular (submodular) and they are compli-ant, that is, for every pairwise disjoint tripleX, Y, Z, b(X∪Z)−p(Y∪Z)≥b(X)−p(Y ).
Note that a pair(α, β)of modular functions is a strong pair if and only ifα≤β. If(p, b)is a strong pair then the poly-hedron
Q(p, b)=x∈RV :p(X)≤x(X)≤b(X),
for everyX⊆V
is called a generalized polymatroid (or a g-polymatroid). When α≤β are modular, we also call the g-polymatroid Q(α, β)abox.
Theorem 6(Frank, Tardos [11]) The intersection of an in-tegral g-polymatroidQ(p, b)and an integral boxQ(α, β)
is an integral g-polymatroid.It is nonempty if and only if
α≤bandp≤β.
Matroids A set systemM=(V ,F)is called amatroidif
Fsatisfies the following three conditions: (I1) ∅ ∈F,
(I2) ifF ∈FandF⊆F, thenF∈F,
(I3) ifF, F∈Fand|F|>|F|, then there existsf ∈F\ Fsuch thatF∪f ∈F.
A subsetX ofV is calledindependentinM ifX∈F, otherwise it is calleddependent. The maximal independent sets ofV are thebasisofM. LetBbe the set of basis ofM. ThenBsatisfies the following two conditions:
(B1) B= ∅,
(B2) ifB, B∈Bandb∈B\B, then there existsb∈B\ Bsuch that(B−b)∪b∈B.
Conversely, if a set system (V ,B) satisfies (B1) and (B2), thenM=(V ,F)is a matroid, whereF= {F ⊆V :
∃B∈B, F⊆B}.
ForS⊂V, the matroidM\Sobtained fromMby delet-ingSis defined asM\S=(V\S,F|V\S), whereX⊆V\S belongs toF|V\S if and only ifX∈F. ForS∈F, the ma-troidM/Sobtained fromMbycontractingS is defined as M/S=(V\S,FS), whereX⊆V \Sbelongs toFSif and only ifX∪S∈F. Let{V1, . . . , Vl}be a partition ofV and a1, . . . , al a set of non-negative integers. ThenM=(V ,F) is a matroid, whereF= {F ⊆V : |F ∩Vi| ≤ai}, we call it partition matroid. ThedualmatroidM∗ofMis defined as follows: the basis ofM∗are the complements of the basis ofM.
Let M=(V ,F) be a matroid and c a cost vector on V = {v1, . . . , vn}. We can find a minimum cost basisFn of Min polynomial time by the greedy algorithm: take a non-decreasing order of the elements ofV :c(v1)≤ · · · ≤c(vn). LetF0be empty and fori=1, . . . , n, letFi=Fi−1+vi if Fi−1+vi ∈F, otherwise letFi=Fi−1.
IfM1andM2 are two matroids on the same ground set V, then we can find a common basis ofM1andM2in poly-nomial time (if there exists one) by the matroid intersection algorithm of Edmonds [4].
Theorem 7 (Edmonds, Rota [18]) For an integer-valued, non-decreasing,submodular functionbdefined on a ground set S, the set {F ⊆S; |F| ≤b(F)for all∅ =F ⊆F}
forms the set of independent sets of a matroid Mb whose rank functionrbis given by
rb(Z)=min
Given an undirected graph G =(V , E) and a non-negative integer vectormonV, letm¯G= ¯mbe the set func-tion defined onEbym(F )¯ =m(V (F ))whereV (F )is the set of vertices covered byF. One can easily check that m¯ is integer valued, non-decreasing and submodular. Thus, by Theorem7,m¯ defines a matroidMm. The following claim¯ is straightforward.
Claim 2 The set{F ⊆E:m(X)≥iF(X),∀X⊆V}is the set of independent sets of the matroidMm.¯
3 Degree constrained sandwich problems
Before studying sandwich problems on orientations of given in-degrees, let us start as a warming up by considering sand-wich problems for undirected and directed graphs of given degrees. These problems reduce to the undirected and di-rectedf-factor problems. We mention that the directed case is much easier than the undirected case because the addition of an arc in a directed graph contributes only to the in-degree of the head and not of the tail, while the addition of an edge in an undirected graph contributes to the degree of both end-vertices. This section contains no new results, we added it for the sake of completeness.
3.1 Undirected graphs
UNDIRECTEDDEGREECONSTRAINEDSANDWICHPROB -LEM
Instance: Given undirected graphsG1=(V , E1)andG2= (V , E2)withE1⊆E2and a non-negative integer vectorf onV.
Question: Does there exist a sandwich graph G=(V , E) (E1⊆E⊆E2)such thatdG(v)=f (v)for allv∈V?
Complexity: It is in P because the answer is YES if and only if there exists an(f (v)−dG1(v))-factor in the optional graphG0=(V , E0).
Characterization: The general f-factor theorem due to Tutte [25] can be applied to get a characterization.
Optimization: The minimum cost f-factor problem in undirected graphs can be solved in polynomial time, see Schrijver [20].
SIMULTANEOUS UNDIRECTED DEGREE CONSTRAINED SANDWICHPROBLEM
Instance: Given two edge-disjoint graphsG1=(V , E1)and G2=(V , E2)inG3=(V , E3)and two non-negative inte-ger vectorsf1andf2onV.
Question: Do there exist simultaneously sandwich graphs ˆ
G1=(V ,Eˆ1) (E1⊆ ˆE1⊆E3)and Gˆ2=(V ,Eˆ2) (E2⊆
ˆ
E2⊆E3)such thatEˆ1∩ ˆE2= ∅anddG1ˆ (v)=f1(v)and dG2ˆ (v)=f2(v)for allv∈V?
Complexity: It is NP-complete because it contains as a special case whether there exist two edge-disjoint perfect matchings so 3-edge-colorability of 3-regular graphs. In-deed, letG=(V , E)be an arbitrary 3-regular graph. LetG1 andG2 be the edgeless graph onV,G3=G andf1(v)= f2(v)=1 for allv∈V. Then the sandwich graphsG1ˆ and
ˆ
G2exist if and only ifE1ˆ andE2ˆ are edge-disjoint perfect matchings of G or equivalently, if there exists a 3-edge-coloring ofG. Since the problem of 3-edge-colorability of 3-regular graphs is NP-complete [16], so is our problem.
3.2 Directed graphs
DIRECTED DEGREE CONSTRAINED SANDWICH PROB -LEM
Instance: Given directed graphs D1=(V , A1) and D2= (V , A2)withA1⊆A2and a non-negative integer vectorf onV.
Question: Does there exist a sandwich graph D=(V , A) (A1⊆A⊆A2)such thatdD−(v)=f (v)for allv∈V? Complexity+Characterization:It is in P because the an-swer is YESif and only if there exists a directed(f (v)− dD1−(v))-factor in the optional directed graphD0=(V , A0), hence we have the following.
Theorem 8 The DIRECTED DEGREE CONSTRAINED SANDWICH PROBLEM has a YES answer if and only if
dD2−(v)≥f (v)≥dD1−(v)for allv∈V.
Optimization:The feasible arc sets form the basis of a par-tition matroid, so the greedy algorithm provides a minimum cost solution.
SIMULTANEOUS DIRECTED DEGREE CONSTRAINED SANDWICHPROBLEM1
Instance: Given two arc-disjoint directed graphs D1 = (V , A1)andD2=(V , A2)inD3=(V , A3)and two non-negative integer vectorsf1andf2onV.
Question: Do there exist simultaneously sandwich graphs ˆ
D1=(V ,Aˆ1) (A1⊆ ˆA1⊆A3) andDˆ2=(V ,Aˆ2) (A2⊆
ˆ
A2⊆A3)such thatA1ˆ ∩ ˆA2= ∅andd−ˆ
D1(v)=f1(v)and d−ˆ
D2(v)=f2(v)for allv∈V?
Complexity:It is in P because the answer is YESif and only ifdD3−(v)≥f1(v)+f2(v),f1(v)≥dD1−(v)andf2(v)≥ dD−
2(v)for allv∈V.
Instance: Given directed graphs D1=(V , A1) and D2= (V , A2)withA1⊆A2and two non-negative integer vectors f andgonV.
Question: Does there exist a sandwich graph D=(V , A) (A1⊆A⊆A2)such thatdD−(v)=f (v)anddD+(v)=g(v) for allv∈V.
Complexity: The feasible arc sets for the in-degree con-straint form the basis of a partition matroid and the feasible arc sets for the out-degree constraint form the basis of a par-tition matroid. The answer is YESif and only if there exists a common basis in these two matroids. Thus it is in P by the matroid intersection algorithm of Edmonds [4].
4 Eulerian sandwich problems
In this section we consider first two problems that were al-ready solved in [12]: Eulerian sandwich problems for undi-rected and diundi-rected graphs. We point out that the undiundi-rected case reduces to T-joins, while the directed case to circula-tions. We show that in both cases the simultaneous versions are NP-complete.
Then we propose to study the problem in mixed graphs. We show two cases that can be solved. The first case will be solved by the Discrete Separation Theorem5of Frank [9], while the second case reduces to the DIRECTEDEULERIAN SANDWICHPROBLEM. The general case, however, remains open.
4.1 Undirected graphs
UNDIRECTEDEULERIANSANDWICHPROBLEM
Instance: Given undirected graphsG1=(V , E1)andG2= (V , E2)withE1⊆E2.
Question: Does there exist a sandwich graph G=(V , E) (E1⊆E⊆E2)that is Eulerian?
Complexity:It is in P because the answer is YESif and only if there exists aTG1-join in the optional graphG0.
Characterization:The answer is YES if and only if each connected component ofG0contains an even number of ver-tices ofTG1.
Optimization:The minimum cost T-join problem can be solved in polynomial time [5].
SIMULTANEOUS UNDIRECTED EULERIAN SANDWICH PROBLEM
Instance: Given two edge-disjoint graphsG1=(V , E1)and G2=(V , E2)inG3=(V , E3).
Question: Do there exist simultaneously Eulerian sandwich graphs G1ˆ =(V ,E1) (E1ˆ ⊆ ˆE1⊆E3)and G2ˆ =(V ,E2)ˆ (E2⊆ ˆE2⊆E3)such thatEˆ1∩ ˆE2= ∅?
Complexity: It is NP-complete because it contains as a special case whether there exist two edge-disjoint perfect matchings so 3-colorability of 3-regular graphs. Indeed, let G=(V , E)be an arbitrary 3-regular graph. LetG3be ob-tained fromGby adding 2 edge-disjoint perfect matchings M1 and M2 to G, let G1=(V , M1) and G2=(V , M2). Then the Eulerian sandwich graphsGˆ1andGˆ2exist if and only ifE1ˆ \M1andE2ˆ \M2are edge-disjoint perfect match-ings ofGor equivalently, if there exists a 3-edge-coloring ofG. Since the problem of 3-edge-colorability of 3-regular graphs is NP-complete [16], so is our problem.
4.2 Directed graphs
DIRECTEDEULERIANSANDWICHPROBLEM
Instance: Given directed graphs D1=(V , A1) and D2= (V , A2)withA1⊆A2.
Question: Does there exist a sandwich graph D=(V , A) (A1⊆A⊆A2)that is Eulerian?
Complexity:It is in P because it can be reformulated as a circulation problem: let f (e)=1, g(e)=1 if e∈A1 and f (e)=0, g(e)=1 ife∈A0. This way the arcs ofA1 are forced and the arcs ofA0can be chosen if necessary. Characterization: The answer is YES if and only if dD−
1(X)≤d +
D2(X)for allX⊆V by Theorem1.
Optimization:The minimum cost circulation problem can be solved in polynomial time, see Tardos [23].
SIMULTANEOUS DIRECTED EULERIAN SANDWICH PROBLEM
Instance: Given two arc-disjoint directed graphs D1 = (V , A1)andD2=(V , A2)inD3=(V , A3).
Question: Do there exist simultaneously Eulerian sandwich graphsD1ˆ =(V ,A1) (A1ˆ ⊆ ˆA1⊆A3)andD2ˆ =(V ,A2)ˆ (A2⊆ ˆA2⊆A3)such thatA1ˆ ∩ ˆA2= ∅?
Complexity:It is NP-complete, it contains as a special case (D1=(V , t1s1), D2=(V , t2s2) andD3=D) the follow-ing directed 2-commodity integral flow problem that is NP-complete [6]: Given a directed graph D and two pairs of vertices,s1, t1 ands2, t2, decide whether there exist a path froms1tot1and a path froms2tot2that are arc-disjoint.
4.3 Mixed graphs
MIXEDEULERIANSANDWICHPROBLEM
Instance: Given mixed graphsH1=(V , E1∪A1)andH2= (V , E2∪A2)withE1⊆E2, A1⊆A2.
Complexity: We provide two special cases that can be treated, while the general problem remains open.
SPECIALCASE1:E1=E2=EanddA2+(X)−dA1−(X)+
ˆ
dE(X)is even for allX⊆V.
Characterization+Complexity:We show that the prob-lem is in P and we provide a characterization.
Theorem 9 TheMIXEDEULERIANSANDWICHPROBLEM
withE1=E2=E anddA2+(X)−dA1−(X)+ ˆdE(X)is even for allX⊆V has aYESanswer if and only if
dA1−(X)−dA2+(X)≤dE(X)∀X⊆V . (11) In particular,this problem is inP.
Proof By the result of Sect.4.2, the answer is YESif and only if there exists an orientationEofEsuch that,∀X⊆V, d−
A1∪ E
(X)≤d+ A2∪ E
(X)or equivalently
d− E(X)−d
+
E(X)≤d +
A2(X)−dA1−(X). (12) Letmbe the in-degree vector ofE. Thend−
E(X)−d +
E(X)=
v∈X(dE−(v) − dE+(v)) =
v∈X(2dE−(v) − dE(v)) = 2m(X)− ˆdE(X), and (12) becomes
2m(X)≤dA2+(X)−dA1−(X)+ ˆdE(X). (13)
Let b(X)= 12(dA2+(X)−dA1−(X)+ ˆdE(X)). Then b, be-ing the sum of a modular function and a submodular func-tion(b(X)=12v∈X(dA+
1(v)−d −
A1(v)+dE(v))+d + A0(X)), is a submodular function and, by the assumption, it is in-teger valued. By Theorem 3, an orientation E satisfying (12) exists if and only if there exists a vectormsuch that iE(X)≤m(X)≤b(X), that is, by Claim1and Theorem5, if and only ifiE(X)≤b(X). This is equivalent to (11) and can be decided in polynomial time by Theorem4, namely the submodular functionb(X)=b(X)−iE(X)must have
minimum value 0.
SPECIALCASE2:E1= ∅.
Characterization+Complexity:It is in P because it can be reformulated as the following problem: We create two copies of each edge in E2and orient them in opposite di-rections. Denote this arc set by −E→22. It is not difficult to see that the graph (V , E2∪A2) has a subgraph contain-ing (V , A1)with an Eulerian orientation if and only if the graph(V ,−E→22∪A2)has a directed Eulerian subgraph con-taining(V , A1). Indeed, in such a graph, if every edge ofE2 is used at most once, we are done. If some edge ofE2is used twice, as two arcs in opposite directions, we can just remove
these two arcs, the obtained graph remaining Eulerian and containing(V , A1). Now applying the result for DIRECTED EULERIANSANDWICHPROBLEMwe have
Theorem 10 The MIXED EULERIAN SANDWICH PROB -LEMwithE1= ∅has aYESanswer if and only if
dA1−(X)−dA2+(X)≤dE2(X)∀X⊆V . (14) In particular,this problem is inP.
Proof LetD1=(V , A1)andD2=(V , A2∪−E→22). By the ar-guments above, the MIXEDEULERIANSANDWICHPROB -LEMwithE1= ∅has a solution if and only if there is an Eulerian sandwich graph for D1 and D2 or equivalently, dD−
1(X)≤d +
D2(X)for all X⊆V. Byd +
D2(X)=d + A2(X)+ dE2(X), we havedA1−(X)−dA2+(X)≤dE2(X)for allX⊆V. Note thatdE2(X)+dA2+(X)−dA1−(X)is a submodular func-tion, and hence by Theorem4, (14) can be verified in
poly-nomial time.
5 m-orientation sandwich problems
In this section we consider the sandwich problem where the propertyis to have an orientation of given in-degrees.
5.1 m-Orientation
m-ORIENTATIONSANDWICHPROBLEM
Instance: Given undirected graphsG1=(V , E1)andG2= (V , E2)withE1⊆E2and a non-negative integer vectorm onV.
Question: Does there exist a sandwich graph G=(V , E) (E1⊆E⊆E2)that has an orientationG whose in-degree vector ismthat isd−
G(v)=m(v)for allv∈V? Characterization:We prove the following theorem.
Theorem 11 The following assertions are equivalent. (a) The m-ORIENTATION SANDWICH PROBLEM has a
YESanswer.
(b) E1is independent inMm¯ andMm¯ has an independent set of sizem(V ).
(c) rm¯(E1)= |E1|andrm¯(E2)≥m(V ). (d) iE1(X)≤m(X)≤eE2(X)for allX⊆V.
Proof
(d) Implies (c). LetF be a subset ofE1andX=V (F ). The condition iE1(X)≤m(X) implies |F| ≤m(V (F ))=
¯
m(F ), that is, |E1| ≤ ¯m(F )+ |E1\F|. By Theorem 7, rm¯(E1)≥ |E1|, or equivalentlyrm¯(E1)= |E1|. Let nowF be a subset ofE2andX=V\V (F ). The conditionm(X)≤ eE2(X)implies thatm(V )≤m(V (F ))+eE2(V−V (F ))≤
¯
m(F )+ |E2\F|. By Theorem7,rm¯(E2)≥m(V ). (c) Implies (b). By definition.
(b) Implies (a). By (b), E1 is independent in Mm¯ and there exists an independent inMm¯ of sizem(V ). Therefore, by(I3), there exists an independent setEof sizem(V )that containsE1. By Theorem3and Claim2,Eis a solution of them-ORIENTATIONSANDWICHPROBLEM. We say that a subsetFofE0isfeasibleif(V , F∪E1)has anm-orientation. The next corollary of Theorem11 charac-terizes the feasible sets.
Corollary 1 If the m-ORIENTATION SANDWICH PROB -LEMhas a YESanswer,then a subsetF ofE0 is feasible if and only ifF is a base of the matroidMm¯/E1.
Complexity:The condition (d) of Theorem11can be veri-fied in polynomial time by Theorem 4, so the m-ORIENTATIONSANDWICHPROBLEMis in P.
Optimization:The minimum cost version of the problem can be solved in polynomial time. First, we find an optimal feasible subsetF by greedy algorithm. Then we can orient the edges ofF ∪E1using a known algorithm. (See [10] for example.)
Corollary1and the matroid intersection algorithm of Ed-monds [4] imply that the two following simultaneous ver-sions of the m-ORIENTATION SANDWICH PROBLEM are also in P.
SIMULTANEOUSm-ORIENTATIONSANDWICHPROBLEM1 Instance: Given two edge-disjoint undirected subgraphs G1=(V , E1) and G2=(V , E2) of an undirected graph G3=(V , E3)and two non-negative integer vectorsm1and m2onV.
Question: Do there exist simultaneously edge-disjoint sand-wich graphs G1ˆ =(V ,E1) (E1ˆ ⊆ ˆE1 ⊆E3) and G2ˆ = (V ,Eˆ2) (E2⊆ ˆE2⊆E3) such that Gˆi has an orientation whose in-degree vector ismi fori∈ {1,2}?
Note that the two input matroids for the matroid intersec-tion algorithm must be taken as(MG1
¯
m1/E1)\E2and the dual matroid of(Mm2G2¯ /E2)\E1.
SIMULTANEOUSm-ORIENTATIONSANDWICHPROBLEM2 Instance: Given two undirected subgraphs G1 =(V , E1)
andG2=(V , E2)of an undirected graphG3=(V , E3)and two non-negative integer vectorsm1andm2onV.
Question: Does there exist an edge setF inE3\(E1∪E2) such that the graphGi=(V , Ei∪F )admits an orientation whose in-degree vector ismi fori∈ {1,2}?
5.2 Strongly connectedm-orientation
STRONGLY CONNECTED m-ORIENTATION SANDWICH PROBLEM
Instance: Given undirected graphsG1=(V , E1)andG2= (V , E2)withE1⊆E2and a non-negative integer vectorm onV.
Question: Does there exist a sandwich graph G=(V , E) (E1⊆E⊆E2)that has a strongly connected orientationG whose in-degree function ism?
Complexity: It is NP-complete because the special case E1= ∅, m(v)=1∀v∈V is equivalent to decide ifG2has a Hamiltonian cycle.
5.3 (m1, m2)-orientation
(m1, m2)-ORIENTATIONSANDWICHPROBLEM
Instance: Given undirected graphsG1=(V , E1)andG2= (V , E2)withE1⊆E2and non-negative integer vectorsm1 andm2onV.
Question: Does there exist a sandwich graph G=(V , E) (E1⊆E⊆E2)that has an orientationG whose in-degree vector ism1and whose out-degree vector ism2?
Complexity:The problem is NP-complete since it contains as a special case (E1= ∅) the NP-complete problem of [19].
5.4 Mixedm-orientation
MIXEDm-ORIENTATIONSANDWICHPROBLEM
Instance: Given mixed graphsG1=(V , E1∪A1)andG2= (V , E2∪A2)withE1⊆E2,A1⊆A2and an non-negative integer vectormonV.
Question: Does there exist a sandwich mixed graph G= (V , E∪A)withE1⊆E⊆E2andA1⊆A⊆A2 that has an orientation−→G =(V ,−→E ∪A) whose in-degree vector is m?
Characterization: Suppose that E1⊆E ⊆E2 has been chosen and oriented, then the problem is reduced to the DI -RECTED DEGREE CONSTRAINED SANDWICH PROBLEM withm1(v)=m(v)−d−→−
E(v) which, by Theorem8, has a solution if and only if dA2−(v)≥m(v)−d−→−
m(v)−dA1−(v)≥d−→−
E(v)≥m(v)−d −
A2(v) for all v ∈V. Letm2:V →Zsatisfym(v)−dA2−(v)≤m2(v)≤m(v)− dA1−(v). By Theorem11, there existsE1⊆E⊆E2 which admits an orientation −→E withd−→−
E(v)=m2(v) if and only ifiE1(X)≤m2(X)≤eE2(X)for allX⊆V. Therefore we have
Claim 3 TheMIXEDm-ORIENTATIONSANDWICHPROB -LEMhas aYESanswer if and only if there exists an integer-valued functionm2:V →Zsuch that,∀v∈V and∀X⊆V, m(v)−dA2−(v)≤m2(v)≤m(v)−dA1−(v),
iE1(X)≤m2(X)≤eE2(X).
Claim 4 The pair(iE1, eE2)is a strong pair.
Proof LetX, Y, Zbe three pairwise disjoint subset ofV. We show thateE2(X∪Z)−iE1(Y∪Z)≥eE2(X)−iE1(Y ). In fact, we haveiE1(Y∪Z)−iE1(Y )=iE1(Z)+dE1(Y, Z)≤ iE2(Z)+dE2(Y, Z), andeE2(X∪Z)−eE2(X)=iE2(Z)+ dE2(Z) −dE2(X, Z). As X, Y, Z are pairwise disjoint, dE2(Y, Z)+dE2(X, Z)≤ dE2(Z). The claim follows by
Claim1.
By Claim3,4and Theorem6applied forα(v)=m(v)− dA2−(v), β(v)=m(v)−dA1−(v), p=iE1, b=eE2, we have
Theorem 12 The MIXED m-ORIENTATION SANDWICH PROBLEMhas aYESanswer if and only if
iE1(X)+ ˆd −
A1(X)≤m(X)≤eE2(X)+ ˆd −
A2(X) (15)
for every subsetXofV.
Note that Theorem12implies Theorems8and11.
Complexity: The condition (15) can be verified in poly-nomial time by Theorem4. If it is satisfied, then a vector m2 satisfying the conditions in Claim 3 can be found us-ing a greedy algorithm for g-polymatroids. Then we find and orient an edge setE(E1⊆E⊆E2) with in-degreem2 (m-ORIENTATIONSANDWICHPROBLEM). Last, we choose an arc set A (A1⊆A⊆A2) such that dA−(v)=m1(v)= m(v)−m2(v), for allv∈V (DIRECTED DEGREE CON -STRAINEDSANDWICHPROBLEM).
6 Contracting sandwich problems
In this section, we propose to consider a new type of sand-wich problem. Instead of deleting edges from the optional graph, we are interested in contracting edges. We solve the problem for the propertybeing a bipartite graph.
CONTRACTINGSANDWICHPROBLEM
Instance: Given an undirected graph G = (V , E) and E0⊆E.
Question: Does there existF ⊆E0such that contractingF results in a bipartite graph?
Complexity: Since a graph is bipartite if and only if all its cycles have an even length, the problem is equivalent to find-ingF ⊆E0such that, for all cyclesC,|C∩F| ≡ |C|mod 2. Fix a spanning forest T of G. For e∈E\T, denote C(T , e)the unique cycle contained inT ∪e. By [18, The-orem 9.1.2], if C is a cycle of G thenC=e∈CC(T , e), wheredenotes the symmetric difference of sets. There-fore, |C ∩F| ≡e∈C|C(T , e)∩F| mod 2. Let CT de-note the collection of cycles C(T , e) of G. The problem is reduced to finding F ⊆E0 such that, for all C ∈CT, |C ∩F| ≡ |C| mod 2, or equivalently, finding an F(= E\F )⊇E1=E\E0such that|F∩C| ≡0 mod 2, for allC∈CT.
Consider now the matrixMdefined as the following. The rows ofM correspond toC ∈CT and the columns corre-spond to the edges ofG; the entryMCeis 1 ife∈Cand is 0 otherwise. ForX⊆E, letχXdenote the characteristic vec-tor ofX. For a vectorx∈ {0,1}E, letx|Xdenote the projec-tion ofxonX. Let1be the all-one vector in{0,1}E. A sub-setF⊆Esatisfies|F∩C| ≡0 mod 2, for allC∈CT, if and only ifχF ∈KerM inF2. Such an F is the solution of the CONTRACTINGSANDWICHPROBLEMif and only if χF|E1=1|E1.
LetB be a basis of the kernel of MinF2. (This can be computed in polynomial time using the Gauss elimination.) Consider the projections B of B on E1. Then the CON -TRACTINGSANDWICHPROBLEMhas a solution if and only if 1|E1 is in the subspace of {0,1}E1 spanned by B, that is, rankB=rankB∪1|E1. This can be decided in polyno-mial time using the Gauss elimination. We conclude that the CONTRACTINGSANDWICHPROBLEMis in P.
We finish with a related problem. For a fixed integerk, solving the CONTRACTING SANDWICH PROBLEM when E0=E with extra requirement |F| ≤k is known to be tractable in polynomial time [14]. However, the authors mention that finding a solution of minimum cardinality is NP-complete.
Acknowledgements This research was partially supported by CNPq, CAPES (Brazil)/COFECUB (France), FAPERJ.
References
1. Dantas S, Klein S, Mello CP, Morgana A (2009) The graph sand-wich problem for P4-sparse graphs. Discrete Math 309:3664–
3673
3. Dourado M, Petito P, Teixeira RB, Figueiredo CMH (2008) Helly property, clique graphs, complementary graph classes, and sand-wich problems. J Braz Comput Soc 14:45–52
4. Edmonds J (1977) Matroid intersection. Discrete Optim 4:39– 49 (Proc Adv Res Inst Discrete Optimization and Systems Appl, Banff, Alta)
5. Edmonds J, EL Johnson (1973) Matching, Euler tours and the Chi-nese postman. Math Program 5:88–124
6. Even S, Itai A, Shamir A (1976) On the complexity of timetable and multicommodity flow problems. SIAM J Comput 5:691–703 7. Figueiredo CMH, Faria L, Klein S, Sritharan R (2007) On the
complexity of the sandwich problems for strongly chordal graphs and chordal bipartite graphs. Theor Comput Sci 38:57–67 8. Ford LR, Fulkerson DR (1962) Flows in Networks. Princeton
Uni-versity Press, Princeton
9. Frank A (1982) An algorithm for submodular functions on graphs. Ann Discrete Math 16:97–120
10. Frank A, Gyárfás A (1976) How to orient the edges of a graph. Colloq Math Soc János Bolyai 18:353–364
11. Frank A, Tardos E (1988) Generalized polymatroids and submod-ular flows. Submodsubmod-ular optimization. Math Program 42(3):489– 563
12. Golumbic MC, Kaplan H, Shamir R (1995) Graph sandwich prob-lems. J Algorithms 19(3):449–473
13. Hakimi SL (1965) On the degrees of the vertices of a directed graph. J Franklin Inst 279(4):290–308
14. Heggernes P, van’t Hof P, Lokshtanov D, Paul C (2011) Obtain-ing a bipartite graph by contractObtain-ing few edges. In: ProceedObtain-ings of
IARCS annual conference on foundations of software technology and theoretical computer science, pp 217–228
15. Hoffman AJ (1960) Some recent applications of the theory of lin-ear inequalities to extremal combinatorial analysis. Proc Symp Appl Math 10:113–127
16. Holyer I (1981) The NP-completeness of edge-coloring. SIAM J Comput 10(4):718–720
17. Iwata S, Fleischer L, Fujishige S (2001) A combinatorial strongly polynomial algorithm for minimizing submodular functions. J ACM 48(4):761–777
18. Oxley JG (1992) Matroid theory. Oxford University Press, New York
19. Pálvölgyi D (2009) Deciding soccer scores and partial orientations of graphs. Acta Univ Sapientiae, Math 1(1):35–42
20. Schrijver A (2003) Combinatorial optimization: polyhedra and ef-ficiency. Algorithms and combinatorics, vol 24. Springer, Berlin 21. Schrijver A (2000) A combinatorial algorithm minimizing
sub-modular functions in strongly polynomial time. J Comb Theory, Ser B 80(2):346–355
22. Sritharan R (2008) Chordal bipartite completion of colored graphs. Discrete Math 308:2581–2588
23. Tardos E (1985) A strongly polynomial minimum cost circulation algorithm. Combinatorica 5(3):247–255
24. Teixeira RB, Dantas S, Figueiredo CMH (2010) The polynomial dichotomy for three nonempty part sandwich problems. Discrete Appl Math 158:1286–1304