• Aucun résultat trouvé

Bounds of graph parameters for global constraints

N/A
N/A
Protected

Academic year: 2022

Partager "Bounds of graph parameters for global constraints"

Copied!
27
0
0

Texte intégral

(1)

RAIRO Oper. Res. 40(2006) 327–353 DOI: 10.1051/ro:2007001

BOUNDS OF GRAPH PARAMETERS FOR GLOBAL CONSTRAINTS

Nicolas Beldiceanu

1

, Thierry Petit

1

and Guillaume Rochart

2

Abstract. This article presents a basic scheme for deriving system- atically a filtering algorithm from the graph properties based represen- tation of global constraints. This scheme is based on the bounds of the graph parameters used in the description of a global constraint. The article provides bounds for the most common used graph parameters.

Keywords.Global constraint, graph constraint, filtering, bound.

Mathematics Subject Classification.68R01.

1. Introduction

One of the main objectives of constraint programming is to provide generic tools for solving combinatorial problems, notably AC algorithms [9,14,18], general purpose combinators [15], and automata for characterizing the solutions of a con- straint [4,20,30]. To deal with real-world problems, various global constraints with ad-hoc filtering algorithms, usually based on graph theory [16, 17, 23–26, 28], have been introduced. In [8], Bessi`ere and Van Hentenryck proposed several definitions of the notion of globality. They introduced the notion of “semantic globality (ex- pressiveness),operational globality (quality of filtering), and algorithmic globality (computational efficiency of the filtering)”. Beldiceanu presented in [2] a system- atic description of these global constraints in terms of graph properties: among the 234 constraints of the catalog of global constraints [5], about 200 constraints are described as a conjunction of graph properties where each graph property has

Received November 16, 2006. Accepted November 20, 2006.

1Ecole des Mines de Nantes, LINA FRE CNRS 2729, 44307 Nantes, France;´ Nicolas.Beldiceanu@emn.fr;Thierry.Petit@emn.fr

2Bouygues e-lab, 78061 St Quentin en Yvelines, France;Grochart@bouygues.com

c EDP Sciences, ROADEF, SMAI 2007

Article published by EDP Sciences and available at http://www.edpsciences.org/roor http://dx.doi.org/10.1051/ro:2007001

(2)

the formP op V, whereP is a graph parameter,op is a comparison operator in {≤,≥,=,=}, andV a domain variable1.

Example 1. Consider thenvalue(N,{x1, ..., xm})constraint [7], whereN, x1, ..., xmare domain variables. Thenvalueconstraint holds if and only if the number of distinct values assigned to the variables inX ={x1, ..., xm}is equal toN. It can be seen as enforcing the following graph property: The number of strongly connected components of theintersection graph G(X, E), whereE={xi∈ X, xj∈ X :xi = xj}, is equal toN.

In the context of the catalog of global constraints, D´avid Han´ak made a pre- liminary exploitation of this description for designing filtering algorithms, for a particular graph property [13]. In this article we present a systematic approach which aims at providing generic filtering algorithms for the most used graph prop- erties [3]: given a specification of a global constraintCin terms of graph properties, we can derive a filtering algorithm forC. Section 2 recalls the representation of global constraints as graph properties. It presents the most used graph parameters on which this article focuses. Section 3 introduces how to filter by reasoning on the bounds of the graph parameters involved in the graph-based description of a global constraint. Section 4 presents how to compute the lower and upper bounds for the graph parameters introduced in Section 2. For those bounds which are not sharp, we focus on the graph classes effectively used in the catalog of global constraints [5] in order to get sharpness for the practical cases. Section 5 recapit- ulates the different bounds and their respective sharpness and complexity class.

Finally, Section 6 illustrates how reasoning on the bounds of graph parameters is relevant in the context of the CP(Graph) framework [10] as well as in the context of over-constrained problems [11].

2. Background

This section summarizes the representation of global constraints as graph prop- erties introduced in [2], and illustrates this framework with the nvalue [7] con- straint.

A global constraint C is represented as an initial digraph Gi = (Xi, Ei): to each vertex inXi corresponds a variable involved inC, while to each arcein Ei

corresponds a binary constraint involving the variables at both extremities ofe.

To generate Gi from the parameters of C, the set of arcs generators described in [2] is used. When all variables ofC are fixed, we remove from Gi all binary constraints which do not hold as well as isolated vertices,i.e., vertices which are not extremity of any arc. This final digraph is denoted byGf. ThenC is defined by a conjunction of graph properties which should be satisfied byGf. Each graph property has the form P op V; P is a graph parameter, V is a domain variable

1Adomain variable is a variable that ranges over a finite set of integers; dom(V), min(V) and max(V) respectively denote the set of possible values for variableV, the minimum possible value forV and the maximum possible value forV.

(3)

x x

x x

2

3 4

5 8

5 1

x x

x x

1 1 2

4 3

(A) (B) (C)

Figure 1. (A) Initial digraphGiassociated with thenvalue(N, {x1, x2, x3, x4}) constraint. (B) Final digraph Gf of the ground solution nvalue(3,{5,8,1,5}). (C) Intermediate digraph when dom(x1) ={5},dom(x3) ={1},dom(x4) ={5} anddom(x2) = {5,8}.

andopis one of the comparison operator≥,≤,=,=. Within the global constraint catalog [5], most commonly used graph parameters are:

NARC andNVERTEX. They respectively denote the number of arcs and vertices. They are used by respectively 95 and 17 global constraints.

NCC and NSCC. They respectively denote the number of connected and strongly connected components. They are used by respectively 19 and 13 global constraints.

NSINKand NSOURCE. They respectively denote the number of ver- tices that do not have any successor and the number of vertices that do not have any predecessor. NSINKandNSOURCEare used by respectively 16 and 15 global constraints. By reversing each arc, the computation of NSINKandNSOURCE is the same. Therefore, the rest of this article considers onlyNSINK.

Example 2. Consider the nvalue(N,X) constraint presented in the introduc- tion. Parts (A) and (B) of Figure 1 respectively show the initial digraph Gi

generated for the nvalue constraint with X = {x1, x2, x3, x4} and the digraph Gf associated with the ground solutionnvalue(3,{5,8,1,5}). Each vertex of Gi

depicts its corresponding variable. All arcs corresponding to equality constraints that are not satisfied are removed to obtainGf fromGi. Each vertex ofGf depicts the value assigned to its corresponding variable. Thenvalueconstraint is defined by the graph propertyNSCC =N. The nvalue(3,{5,8,1,5}) constraint holds sinceGf contains three strongly connected components, which can be interpreted as the fact thatN is equal to the number of distinct values taken by the variables x1, x2, x3 andx4. Part (C) of Figure 1 will be referenced in Example 3.

3. Filtering from graph properties

Given a graph property P op V occurring in the description of a global con- straint, this section first shows how to reduce the domain ofV in order to enforce P op V. Finally, it discusses the case where several graph properties are used to define a global constraint.

(4)

3.1. Handling one single graph property

We first introduce the notion of intermediate digraph derived from the initial digraph Gi, where vertices and arcs can have different status as detailed below.

The purpose of this intermediate digraph is to reflect the knowledge we currently have about the vertices and the arcs ofGithat may or may not belong to the final digraphGf. The lower and upper bounds of a graph property will be computed from this intermediate digraph. This knowledge comes from two sources:

Because of the current domain of its variables, a binary constraint associ- ated with an arc ofGi does not hold (or is entailed).

Because of an external reason (e.g., if a global constraint is defined by two graph properties on the same initial digraphGi then an arc may be forced to belong toGf by one of the two properties), a given arc or vertex ofGi

is forced to belong toGf (or is forced not to belong toGf).

When a global constraintC is posted, the intermediate digraph corresponds to the initial digraph Gi, while, when all variables of C are fixed, the intermediate digraph is equal to the final digraphGf. At any stage all the possible final digraphs are induced digraphs of the intermediate digraph.

Notation 1. Let Gi = (Xi, Ei) be the initial digraph of a global constraint C, and Gf = (Xf, Ef) its final digraph. At a given step corresponding to a partial assignment of values to the variables ofC, we classify a vertexvj ∈Xi and an arc ek∈Ei as follows:

vjis aT-vertex (i.e., atrue-vertex) if and only ifvj ∈Xf;vj is aF-vertex (i.e., afalse-vertex) if and only ifvj∈/Xf; otherwisevjis aU-vertex (i.e., an undetermined-vertex). XT,XF andXU respectively denote the sets of T-vertices, ofF-vertices and of U-vertices.

ek is a T-arc (i.e., a true-arc) if and only if ek Ef; ek is a F-arc (i.e., a false-arc) if and only ifek∈/Ef; otherwiseek is anU-arc (i.e., an undetermined-arc). ET,EF andEU respectively denote the sets ofT-arcs, ofF-arcs and ofU-arcs.

For two distinct elementsQandRin{T, U, F}, letXQR denote the vertex subset XQ˙ XR, andEQR denote the arc subsetEQ˙ ER.

The following definition of the intermediate digraph takes into account the fact that the final digraphGf will not contain any isolated vertex (i.e., a vertex not involved in any arc) [5, page 45].

Definition 1. The intermediate digraph is the digraph defined from the initial digraphGi, from the sets of verticesXT, XF, XU and from the sets of arcsET, EF,EU by applying the next rules while they induce some modifications:

Remove allF-arcs from Gi.

AnyF-vertex which is not the extremity of at least oneT-arc is removed from Gi2. When a vertex is removed, we remove also all its ingoing and outgoing arcs that are turned intoF-arcs.

2AF-vertex that is linked to aT-arc is not removed so that Property 1 catches a contradiction.

(5)

AnyU-vertex, which is not the extremity of at least one arc, is turned into aF-vertex.

AnyU-vertex, which is an extremity of aT-arc, is turned into aT-vertex.

If a T-vertex with no loop has a unique neighbor, which is a U-vertex, then thisU-vertex is turned into aT-vertex.

If aT-vertex is the extremity of exactly oneU-arceand not the extremity of anyT-arc, theneis turned into aT-arc.

When a vertex or an arc is removed from Gi, or when the status of a vertex or of an arc is changed by one of the previous rule, the sets of verticesXT,XF,XU

and the sets of arcsET,EF,EU are updated to reflect this change.

Example 3. Consider again the nvalue(N,X) constraint presented in the in- troduction, and assume that not all variables of X = {x1, x2, x3, x4} are fixed:

dom(x1) ={5},dom(x2) ={5,8},dom(x3) ={1},dom(x4) ={5}. Furthermore, without loss of generality, assume that, for an equality constraint ec associated with an arc of the initial digraphGi of nvalue, entailment is only detected when the two variables occurring inec are fixed3. This leads to partition the arcs of Gi in the following three sets ET = {(x1, x1),(x1, x4),(x3, x3),(x4, x1),(x4, x4)}, EU = {(x1, x2),(x2, x1),(x2, x2),(x2, x4),(x4, x2)} and EF = {(x1, x3),(x2, x3), (x3, x1),(x3, x2), (x3, x4),(x4, x3)}. The status of the vertices is initially set un- determined (i.e., XU ={x1, x2, x3, x4}) and we apply the rules of Definition 1 in order to obtain the intermediate digraph depicted by Part (C) of Figure 1. A solid line depicts aT-vertex or aT-arc, while a dashed line indicates aU-vertex or an U-arc. The same style will be used in all other figures of this article in order to depictT-vertices,T-arcs,U-vertices andU-arcs.

Property 1. From the definition of Gf, a global constraint C has no solution if its intermediate digraph contains aF-vertex or if it contains a T-vertex that is not the extremity of any arc.

Given a graph propertyPop V associated with a global constraintC, the inter- mediate digraph will be used for evaluating a lower boundP and an upper bound P of the graph parameter P. Section 4 provides graph invariants for evaluating P and P for different graph parameters. It assumes that all U-vertices or arcs of the intermediate digraph can be freely turned into T-vertices orT-arcs (resp.

F-vertices orF-arcs). According to the comparison operatorop, Table 1 gives the four possible cases for reducing the domain of variableV according toP andP. 3.2. Handling several graph properties

Quite often, it happens that one wants to enforce the final digraph Gf of a global constraintCto verify more than one graph property. In this context, these graph properties involve several graph parameters that cannot vary independently.

So, in order to get stronger necessary conditions for the feasibility of C we can search for graph invariants that link the different graph parameters. These graph

3As a consequence, sincex2is not yet fixed, the arc (x2, x2) is anU-arc.

(6)

Table 1. The four possible cases for reducing the domain of a variableV according toP andP.

P ≤V min(V)max(P ,min(V)) P ≥V max(V)min(P ,max(V))

P =V min(V)max(P ,min(V))max(V)min(P ,max(V)) P =V P=P ⇒P /∈dom(V)

invariants are typically inequalities between two arithmetic expressions mentioning several graph parameters4. In this context each graph invariant will be used in order to adjust the minimum and the maximum value of its graph parameters. An initial lower and upper bound of each graph parameter will be computed by using the inequalities of Section 4. Finally we make a last observation: quite often, it happens that the final digraph Gf associated with a global constraint has a regular structure that comes from its initial digraph or from a property of the arc constraint. In this context we can have tighter graph invariants which hold for specific graph classes.

Example 4. Consider again thenvalueconstraint. Bessi`ereet al.[7] give a nec- essary condition based on a result by Tur´an [27]. For the final digraphGf of the nvalue constraint, which is symmetric, reflexive and transitive5, this necessary condition6 links thenumber of strongly connected components, thenumber of ver- tices and the number of arcs ofGf: NSCC

NVERTEX2 NARC

. This allows us to evaluate the minimum number of distinct values according to the number of vari- ables of the nvalue constraint (i.e., NVERTEX, which is fixed to the number of variables of the nvalue constraint since each vertex of the initial digraph be- longs to the final digraph) and to the maximum number of arcs of its intermediate digraph (i.e.,NARC).

4. Bounds of graph parameters

This section is devoted to the evaluation of lower and upper bounds of the graph parameters introduced in Section 2. For this purpose, we will deal with graphs derived from the intermediate digraph with different sets of arcs and vertices that are described by the following notations.

4See Chapter 3 of [5] for a collection of about 200 graph invariants.

5Gf consists of one or several cliques.

6We recast the original condition given in [7] to the context of the intermediate digraph of thenvalueconstraint.

(7)

Notation 2. For any words Q,R and S on the alphabet {T, U, F},XQ andXS

are vertex subsets and ER is an arc subset of the initial digraph Gi (as stated in the last part of notation 1), and:

XQ,R (resp. XQ,¬R) denotes the set of vertices in XQ which are incident with at least one arc (resp. with no arc) in ER:

XQ,R={x∈XQ | ∃e∈ER∧x∈e} andXQ =XQ,R˙ XQ,¬R.

XQ,R,S (resp.XQ,R,¬S) denotes the set of vertices inXQ,Rthat are neigh- bors to at least one vertex (resp. to no vertex) in XS by an arc in ER: XQ,R,S = {x XQ,R | ∃y XS ((x, y) ER(y, x) ER)} and XQ,R=XQ,R,S˙ XQ,R,¬S.

XQ,¬R,S (resp. XQ,¬R,¬S) denotes the set of vertices in XQ,¬R that are neighbors to at least one vertex (resp. to no vertex) in XS by an arc in ET U:

XQ,¬R,S ={x∈XQ,¬R | ∃y ∈XS((x, y)∈ET U (y, x)∈ET U)} and XQ,¬R=XQ,¬R,S˙ XQ,¬R,¬S.

ER,Q is the set of arcs inER which are incident to at least one vertex in XQ:

ER,Q={e∈ER | ∃x∈XQ∧x∈e}.

ER,Q,S is the set of arcs in ER which are incident to one vertex in XQ

and to one vertex inXS:

ER,Q,S={e∈ER | ∃x∈XQ∧ ∃y∈XS(e= (x, y)∨e= (y, x))}. Based on the previous notations, we define two kinds of graphs, whereX is a set of vertices andE a set of arcs:

−→

G(X,E) denotes the digraph defined by the vertex set X and the subset of arcs ofE having their two extremities inX.

←→G(X,E) denotes the undirected graph derived from −→G(X,E) by keeping all vertices of X and by considering one edge (u, v) (where u and v are not necessarily distinct) when at least one arc in{(u, v),(v, u)}belongs to

→G(X,E).

Within the last notation←→

G(X,E), note that Estill refers to the set of arcs of the corresponding digraph−→

G(X,E) (and not to the derived sets of edges). This nota- tion is used either when any two arcs (u, v) and (v, u) in E have the same status, or when we do not care about the status of the arcs. Note also that−→G(XT U, ET U) is the intermediate digraph introduced by Definition 1.

As we will see later, computing lower and upper bounds of graph parameters can essentially be seen as computing some graph parameters on the graphs previously introduced. For this reason we define the following notations for a digraphG.

Notation 3. cc(G), scc(G), sink(G) and source(G) respectively denote the set of connected components, strongly connected components, sinks and sources ofG.

Similarly, in order to restrict to specific induced subgraphs where a given condi- tion cond is required on each subgraph we use the following notation: cc[cond](G), scc[cond](G), sink[cond](G) and source[cond](G).

(8)

Example 5. For instance, the set of connected components of −→G(XT U, ET U) containing at least oneT-arc is denoted bycc[|ET|≥1](−→

G(XT U, ET U)).

Some bounds will be expressed in terms of graph parameters that correspond to non-polynomial problems. However in such a case we will provide bounds that are sharp. Note that many of the digraphs, which express a global constraint, belong to specific graph classes for which a non-polynomial problem becomes polynomial.

Even when the computation is polynomial, we can get better worst-case complex- ity by exploiting the structure of the intermediate digraph. For instance, in the context of thegroupconstraint [3], we have to estimate the minimum number of connected components of the final digraphGf. For this purpose, Property 10 in Section 4 requires to compute the number of connected components on the inter- mediate digraph. This digraph is a subgraph of an elementary path augmented with loops [5], p. 516. Therefore the complexity for computing the number of connected components is linear in the number of vertices.

Example 6. We illustrate some sets of vertices and arcs previously introduced and some graphs on the intermediate digraph depicted by Part (C) of Figure 1:

XT ={x1, x3, x4}denotes the set of T-vertices.

XU ={x2}denotes the set ofU-vertices.

ET = {(x1, x1),(x1, x4),(x3, x3),(x4, x1),(x4, x4)} denotes the set of T-arcs.

EU = {(x1, x2),(x2, x1),(x2, x2),(x2, x4),(x4, x2} denotes the set of U-arcs.

XU,T = denotes the set ofU-vertices that are the extremity of at least oneT-arc. Observe that, from Definition 1, this set is always empty.

XU,¬T ={x2} denotes the set ofU-vertices that are not the extremity of anyT-arc. Observe that, from Definition 1, this set is always equal toXU.

ET U = {(x1, x1),(x1, x2),(x1, x4),(x2, x1),(x2, x2),(x2, x4),(x3, x3),(x4, x1),(x4, x2),(x4, x4)}denotes the set of arcs that areU-arcs orT-arcs.

EU,T ={(x1, x2),(x2, x1),(x2, x4),(x4, x2)}denotes the set ofU-arcs such that at least one of their extremities is aT-vertex.

−→G(XT, ET) =−→G({x1, x3, x4},{(x1, x1),(x1, x4),(x3, x3),(x4, x1),(x4, x4)}) denotes the digraph defined by the set of verticesXT and the arcs of ET

that have their two extremities inXT.

We now go through the different graph parameters and provide for each of them a lower and an upper bound. For each graph parameter, we give typical examples of global constraints for which the graph-based description presented in [5] uses that parameter.

4.1. Bounds for the number of arcs

Within [5],NARCandNARCare respectively referenced in the description of about 50 constraints (see,e.g., thedisjoint(p. 436), theelement(p. 460) and the inverse(p. 568) constraints) and of 80 constraints (see,e.g., thechange(p. 284) and theelement sparse(p. 486) constraints).

(9)

4.1.1. Estimating NARC

Before presenting the idea behind the lower bound on the number of arcs we first need to introduce the notions ofmatching and ofedge cover.

Definition 2. Given an undirected graphG, amatching ofGis a set of edges of G, excluding loops, such that no two edges have a vertex in common. Amaximum matching is a matching of maximum cardinality. µ(G) depicts the cardinality of a maximum matching ofG.

Definition 3. Anedge cover of an undirected graphGis a subsetS of edges ofG such that, for each vertexvofG, there is at least one edgeeofSsuch thatvis an extremity ofe. Aminimum edge cover is an edge cover of minimum cardinality.

The minimum number of arcs in the final digraph Gf will be at least equal to the current number of T-arcs |ET|. Moreover, in −→G(XT, ET) some isolated T-vertices may remain. Since they will belong to Gf, each of them will be the extremity of at least one arc inGf. Therefore the lower bound is equal to |ET| plus the minimum number ofU-arcs of the intermediate digraph −→G(XT U, ET U) required to cover all T-vertices that are not extremities of an arc in ET. This second quantity is computed polynomially on an undirected graph derived from

←→G(XT U, EU)7. The principle is first to identify the number of isolatedT-vertices in −→

G(XT, ET) which can be joined one another by turning U-arcs into T-arcs, since this allows saving one arc in the estimation, for some of them. For all other isolatedT-vertices in−→G(XT, ET) an extra arc will be required.

Property 2. NARC≥ |ET|+|XT,¬T| −µ(←→G(XT,¬T, EU)).

Proof. By definition∀e∈ET :e∈Ef(i.e.,T-arcs belong toGf). ThusNARC

|ET|. Moreover in ←→

G(XT, ET) some vertices may have a null degree. Since they will necessarily belong to Gf (sinceGf does not contain isolated vertices), addi- tional arcs will be required for connecting them. We consider the undirected graph

←→

G(XT,¬T, EU), build withT-vertices of null degree in←→

G(XT, ET) as well as the U-arcs between these vertices. XT,¬T can be partitioned into the two setsXT,¬T,¬T

andXT,¬T,T. Vertices of the first set cannot be connected one another, therefore one new arc will be necessary for each of them: NARC≥ |ET|+|XT,¬T,¬T|. Ver- tices of the second set might be connected each other. We will need at least a num- ber of arcs equal to the cardinality of a minimum edge cover in←→

G(XT,¬T,T, EU).

From [19] we know that this quantity is|XT,¬T,T|−µ(←→G(XT,¬T,T, EU)). Since we consider a partition of vertices and since by definition all edges in←→G(XT,¬T,T, EU) involve only vertices of XT,¬T,T, from NARC ≥ |ET| +|XT,¬T,¬T| we have NARC ≥ |ET|+|XT,¬T,¬T|+|XT,¬T,T| −µ(←→G(XT,¬T,T, EU)). Observe that

|XT,¬T,¬T|+|XT,¬T,T|=|XT,¬T|. Moreover by definition←→G(XT,¬T,¬T, EU) has

7Since in

G(XT U, EU) all arcs have the same status (i.e.,U-arcs), we can safely consider the undirected graphG(XT U, EU).

(10)

(A)

4

1 2 3

5 6 7

4

1 2

5 6 7

(C) (B)

4

6 7

Figure 2. (A) Intermediate digraph and (B) undirected graph used to compute the cardinality of a maximum matching for es- timatingNARC. (C) Example of a final digraph achieving the lower bound.

no edges (All vertices of←→

G(XT,¬T,¬T, EU) belong to XT,¬T,¬T, which is contra- dictory with the fact of having an arc joining two of them in−→G(XT,¬T,¬T, EU).).

Thereforeµ(←→G(XT,¬T,T, EU)) =µ(←→G(XT,¬T, EU)). The property holds.

Example 7. Figure 2 illustrates Property 2. It shows how to computeNARC according to the intermediate digraph−→G(XT U, ET U) given by Part (A). Part (B) shows the corresponding undirected graph ←→G(XT,¬T, EU) used for computing the cardinality of a maximum matching. We have ET = {(1,1),(1,2),(5,1)}, EU ={(1,5),(2,6),(3,4),(4,4), (5,6),(6,7),(7,3)}, XT,¬T ={4,6,7},|ET| = 3,

|XT,¬T| = 3, µ(←→G(XT,¬T, EU)) = 1, thus NARC 3 + 31 = 5. Part (C) provides a final digraph where this lower bound of 5 arcs is reached.

Property 3. The lower bound provided by Property 2 is sharp.

Proof. We can build a final digraph by adding to the current digraph−→G(XT, ET):

For each x∈ XT,¬T,¬T any U-arc in ←→

G(XT, EU) such that xis an ex- tremity.

For each edge of a minimum edge cover of ←→

G(XT,¬T,T, EU) one arc in

→G(XT,¬T,T, EU) having the same extremities than that edge.

By definition allT-vertices will be covered, and the total number of arcs will be equal to|ET|+|XT,¬T| −µ(←→G(XT,¬T, EU)).

4.1.2. Estimating NARC Property 4. NARC≤ |ET U|.

Proof. By definition of −→G(XT U, ET U), any arc of the initial digraph that does not belong toET U will also not belong to the final digraphGf. Thus NARC

|ET U|.

Property 5. The upper bound provided by Property 4 is sharp.

Proof. If all arcs of−→

G(XT U, ET U) belong toGf thenNARC=|ET U|.

(11)

4.2. Bounds for the Number of Vertices

Within [5], NVERTEX is only used in graph properties of the form NVERTEX=variable, where variable is a domain variable, which means that we need to both evaluate NVERTEX as well as NVERTEX. NVERTEX is referenced in about 15 constraints such as, for instance, cutset (p. 382) or group(p. 516).

4.2.1. Estimating NVERTEX

Before presenting the idea of the lower bound on the number of vertices we first need to introduce the notions ofbipartite graph and ofhitting set.

Definition 4. An undirected graph G(X, E) is bipartite if there is a partition (Y, Z) ofX such that ∀(u, v)∈E, eitheru∈Y and v∈Z, oru∈Z andv∈Y. Such a graph will be denoted byG((Y, Z), E).

Definition 5. Given a bipartite graphG((Y, Z), E), ahitting set[12] ofG((Y, Z), E) is a subsetZ of Z such that for any vertexy ∈Y there exists an edge inE connectingyto a vertex inZ. h(G) denotes thecardinality of a minimum hitting set ofG8.

When estimatingNVERTEX, we know that allT-vertices will belong toGf. Since Gf does not contain isolated vertices and since −→G(XT, ET) may contain isolated vertices, some additionalU-vertices may have to be turned toT-vertices, in order to connect those vertices. All isolated vertices in−→G(XT, ET) that are the extremity of anU-arc such that the other extremity is aT-vertex may be connected toGf by that arc. Therefore we ignore these vertices. This case includes the case ofU-loops where the extremity is aT-vertex. From the remaining isolated vertices, the number of required additional vertices is equal to the cardinality of a minimum hitting set in an undirected graph derived from←→G(XT U, EU).

Property 6. NVERTEX≥ |XT|+h(←→G((XT,¬T,¬T, XU,¬T,T), EU,T)).

Proof. In the previous formula,XT,¬T,¬T represents the set ofT-vertices that are not the extremity of anyT-arcs and that have not aT-vertex as neighbor, while XU,¬T,Tis the set ofU-vertices that have at least oneT-vertex as neighbor. Finally EU,T is the set ofU-arcs such that at least one of their extremities is aT-vertex.

AllT-vertices inXT will belong toGf. Starting from the point thatGf cannot contain isolated vertices, some vertices inXT having a null degree in←→G(XT, ET) may require to turn someU-vertices intoT-vertices. By definition this is not the case for vertices inXT,T. This is also not the case for vertices which are not covered by aT-arc but which are the extremity of an arc inEU where the other extremity is a T-vertex (i.e., the setXT,¬T,T). (XT,T, XT,¬T,T, XT,¬T,¬T) is a partition of XT: let us consider now the case of vertices in XT,¬T,¬T. They are not directly

8From [12], computing the exact value of the cardinality of a minimum hitting set is NP-Hard in the general case.

(12)

2

2

6

3 5

7

4

(B) (A)

3

1 4

5 6 7

(C)

7 6

1 3

XT,¬T,¬T

XU,¬T,T

Figure 3. (A) Intermediate digraph and (B) undirected graph used to compute the cardinality of a minimum hitting set for es- timatingNVERTEX. (C) Example of a final digraph achieving the lower bound.

connected one another neither by aT-arc nor by anU-arc. Therefore if this set is not empty then someU-vertices will be forced to be turned to T-vertices. Those U-vertices must be an extremity of at least one edge containing a T-vertex, so we consider XU,¬T,T, and the arcs joining them toT-vertices. By definition the minimum number of vertices inXU,¬T,T required to cover all vertices inXT,¬T,¬T

ish(←→G((XT,¬T,¬T, XU,¬T,T), EU,T)). The property holds.

Example 8. Figure 3 illustrates Property 6. It shows how to compute the lower bound ofNVERTEXaccording to the intermediate digraph−→G(XT U, ET U) depicted by Part (A) of Figure 3. Part (B) illustrates the corresponding bi- partite graph ←→G((XT,¬T,¬T, XU,¬T,T), EU,T) used for computing the cardinal- ity of the minimum hitting set. We have XT = {1,3,6}, EU,T ={(1,1),(1,2), (3,4),(5,1),(5,6),(6,7),(7,3)},XT,¬T,¬T ={3,6},XU,¬T,T ={2,4,5,7},|XT|= 3 andh(←→

G((XT,¬T,¬T,XU,¬T,T),EU,T)) = 1 (i.e., 7 allows to cover both 6 and 3), thusNVERTEX3 + 1 = 4. Part (C) provides a final digraph where this lower bound of 4 vertices is reached.

Property 7. The lower bound provided by Property 6 is sharp.

Proof. Following the schema of the proof, it is possible to build a final digraph from ←→G(XT, ET) by turning to T-vertices h(←→G((XT,¬T,¬T, XU,¬T,T), EU,T))U-

vertices.

4.2.2. Estimating NVERTEX Property 8. NVERTEX≤ |XT U|.

Proof. By definition of−→G(XT U, ET U), any vertex of the initial digraph that does not belong to XT U will also not belong to the final digraph Gf. Thus

NVERTEX≤ |XT U|.

Property 9. The upper bound provided by Property 8 is sharp.

(13)

Proof. This upper bound is reached when all vertices of−→G(XT U, ET U) belong to

the final digraphGf.

4.3. Bounds for the number of connected components

Within [5], NCC is most of the time used in graph properties of the form NCC=variable, wherevariable is a domain variable, which means that we need to both evaluateNCCas well asNCC. NCCis referenced in about 18 constraints such as, for instance,cycle(p. 386),group(p. 516) ortree(p. 902).

4.3.1. Estimating NCC

Property 10. NCC≥ |cc[|XT|≥1](−→G(XT U, ET U))|.

Proof. First observe that from Property 1, −→G(XT U, ET U) cannot have a con- nected component consisting of one single isolatedT-vertex. Second, note that all arcs and vertices of a connected component of −→G(XT U, ET U), where there is no T-vertices, may finally not belong toGf. We can ignore them. To obtain inGf

less connected components than the ones of−→G(XT U, ET U) containingT-vertices, it is necessary to have at least one new arc that joins two of them. This is not possible because −→G(XT U, ET U) contains all the arcs that will potentially belong

toGf. The property holds.

Property 11. The lower bound provided by Property 10 is sharp.

Proof. Build a final digraph with all arcs and vertices from ET U that belong to a connected component of the setcc[|XT|≥1](−→

G(XT U, ET U)). All the otherU-arcs from ET U are removed. The number of connected components will be equal to

|cc[|XT|≥1](−→

G(XT U, ET U))|.

4.3.2. Estimating NCC

T-vertices and T-arcs of −→G(XT U, ET U) will necessarily belong to Gf. If we exceptT-vertices with no predecessor and no successor in−→G(XT, ET) we are able to count in −→G(XT U, ET U) a certain number of connected components with only T-vertices andT-arcs. By definition, augmenting any of these connected compo- nents by new arcs cannot increase their number. Therefore, the intuitive idea for computing an upper bound ofNCCis first to count these connected components, to remove them from−→G(XT U, ET U), to remove also all the arcs connected to them, and then to estimate the maximum number of connected components that may exist in the remaining digraph.

We have to take into account that someT-vertices with no predecessors and no successors in−→G(XT, ET) may exist. These ones will belong toGf. If they are fi- nally connected to one of the connected components ofcc[|ET|≥1](−→G(XT, ET)) (i.e., the set of connected components of−→G(XT, ET) containing at least oneT-arc), then they will not increase the number of connected components. Therefore, we can

(14)

ignoreT-vertices with no predecessors and no successorsexclusively connected to the connected components previously counted9 in cc[|ET|≥1](−→G(XT, ET)). Sim- ilarly we have to ignore U-vertices which are also exclusively connected to the connected components incc[|ET|≥1](−→G(XT, ET)).

Definition 6. −→Grem = (Xrem, Erem) is the digraph obtained from−→G(XT U, ET U) by first removing all vertices present in the set of connected components cc[|ET|≥1](−→G(XT, ET)) and then removing all vertices becoming isolated in the remaining digraph.

Property 12. From Definition 6 we have:

No vertex is common to Xrem and to a connected component of cc[|ET|≥1](−→G(XT, ET)).

AllT-arcs belong to connected components incc[|ET|≥1](−→G(XT, ET)).

Any vertex, which is neither present inXrem nor incc[|ET|≥1](−→G(XT, ET)), cannot be an extremity of an arc involving a vertex ofXrem.

Proof. By construction of−→Grem.

From Property 12 we can safely add|cc[|ET|≥1](−→G(XT, ET))|to an estimation of the maximum possible number of connected components in any final digraph derived from−→Grem. This will give us the estimationNCCwe are looking for. Let us now go into details.

Notation 4. NCCrem denotes the maximum possible number of connected com- ponents in any final digraph derived from −→

Grem.

Notation 5. ←→Grem = (Xrem, Erem) is the undirected graph obtained from the undirected graph←→G(XT U, EU)by removing all vertices present incc[|ET|≥1](−→G(XT, ET))and then all vertices becoming isolated in the remaining undirected graph.

Definition 7. Given an undirected graphG, which eventually contains loops, a l-matching ofGis a set of edges such that no two edges have a vertex in common.

Amaximum l-matching is a l-matching of maximum cardinality10. µl(G) denotes thecardinality of a maximum l-matching ofG.

Observe that a l-matching can contain loops.

Property 13. NCCrem =µl(←→Grem).

9We do not loose the sharp aspect of the evaluation because if such a vertex is connected by only one arc to a connected component then this does not decrease the number of connected components. It is possible to build a final digraph where all such vertices satisfy this property (that is, connect them only by one arc to a connected component ofcc[|ET|≥1](G(XT, ET))).

10Existing polynomial algorithms for computing maximum matchings can be adapted to this case: each loop can be unfolded by creating a new vertex and then those algorithms apply.

(15)

Proof. For evaluating the maximum possible cardinality of a set of connected com- ponents in any final digraph derived from−→Grem, we evaluate the maximum number nsof subgraphs containing at least one edge among all sets of subgraphs built from

←→Grem as follows (we have to consider subgraphs with at least one edge because in the final digraphGf any vertex will be the extremity of at least one arc). Let S be such a set of subgraphs. To each subgraph inScorresponds a subset of vertices and a subset of edges of←→Grem forming a connected component, such that no two subgraphs inS have a vertex in common.

Among the setsS where each subgraph is formed either by a single edge or by an isolatedU-vertex,nsis by construction equal to the cardinality of a maximum l-matching. ThereforeNCCrem ≥µl(←→Grem).

Let us now prove by induction on the number of edges of←→GremthatNCCrem µl(←→Grem). For a graph ←→Grem reduced to one single edge this is true. Assume that this is true for a graph ofmedges. We show that this still holds for a graph

←→Grem withm+ 1 edges. LetS be a set of subgraphs of←→Grem that maximizes the number of subgraphs containing at least on edge. Two possible cases may occur forS:

Any subgraph in S contains at most one edge. In this case it forms a maximuml-matching andns=µl(←→Grem).

There is a subgraphs∈S containingk >1 edges.

Either there exists one edge inswhose removal creates two connected components, each of them involving at least one edge. This contra- dicts the fact thatS maximizes the number of subgraphs containing at least one edge.

Or such an edge does not exists. In this case removing any edge of s has no impact onnsand by the induction hypothesis, nsis equal to the cardinality of a maximum l-matching on the graph ←→Grem

obtained from←→Grem by removing that edge.

By definition of a maximum l-matching, any maximum l-matching of

←→Grem have a cardinality greater than or equal to µl(←→Grem) when µl(←→Grem) is obtained from ←→Grem by removing one edge. NCCrem µl(←→Grem).

The property holds.

Property 14. NCC≤ |cc[|ET|≥1](−→

G(XT, ET))| +µl(←→ Grem).

Proof. From Property 12, any arc has at least either a vertex incc[|ET|≥1](−→G(XT,

ET)), or a vertex in−→Grem.

Example 9. Figure 4 illustrates Property 14. It shows how to compute the upper bound ofNCCaccording to the intermediate digraph−→G(XT U, ET U) depicted by Part (A) of Figure 4. In Part (A),C1 andC2 corresponds to the connected com- ponents of−→G(XT, ET) that have at least oneT-arc (i.e.,cc[|ET|≥1](−→G(XT, ET))).

(16)

8 4 3

(B) (C)

4

7 6

5

3 2

1

(A)

1 2 3 4

5 6 7 8

C2

C1

Figure 4. (A) Intermediate digraph and (B) undirected graph used to computeNCCrem for estimatingNCC. (C) Example of a final digraph achieving the upper bound.

Part (B) illustrates the corresponding undirected graph←→

Grem on which we com- pute a maximuml-matching. We have |cc[|ET|≥1](−→G(XT, ET))|= 2,NCCrem = µl(←→Grem) = 2, thus NCC2 + 2 = 4. Part (C) provides a final digraph where this upper bound of 4 connected components is reached.

Property 15. The upper bound provided by Property 14 is sharp.

Proof. From Property 13,NCCrem is a sharp upper bound of the number of con- nected components of←→Grem. From Property 13,NCCrem =µl(←→Grem). Within

→G(XT U, ET U), the upper boundNCCrem is related to allU-arcs such that their vertices are eitherU-vertices, orT-vertices with neither predecessor nor successor in −→G(XT, ET), that is,T-vertices that do not belong to a connected component ofcc[|ET|≥1](−→G(XT, ET)).

The exact number of connected components of−→G(XT, ET) containing at least one T-arc is |cc[|ET|≥1](−→G(XT, ET))|. Within −→G(XT U, ET U), from Property 12, allT-arcs of−→

G(XT U, ET U) belong tocc[|ET|≥1] (−→

G(XT, ET)).

Finally, considerU-arcs such that at least one of their two vertices is aT-vertex belonging tocc[|ET|≥1](−→G(XT, ET)). By construction turning any of such anU-arc to a T-arc will augment a previously counted connected component ofcc[|ET|≥1]

(−→G(XT, ET)), but cannot create a new one. Therefore,|cc[|ET|≥1](−→G(XT, ET))|+ µl(←→

Grem) is a sharp bound.

4.4. Bounds for the number of strongly connected components Within [5], NSCC is most of the time used in graph properties of the form NSCC = variable, where variable is a domain variable. This means that we need to both evaluateNSCCas well as NSCC. NSCCis referenced in about 12 constraints such as, for instance, not all equal(p. 688),nvalue (p. 698) or soft alldifferent var(p. 814).

(17)

6 7 8 4

3 2 1 1

10 11 9

8 7 6 5 4

2 3

(A) (B) (C)

C9 C9

Z Y C8

C3 C4 C5 C6 C7

C1 C2

C7 C9 C6 C2

C3 C5 C6 C7

C8

Figure 5. (A) Intermediate digraph and (B) corresponding bipartite graph used to compute the cardinality of a minimum hitting set. (C) Example of a final digraph achieving the lower bound.

4.4.1. Estimating NSCC

Property 16. NSCC ≥ |scc[|XT|≥1](−→G(XT U, ET U))| +h(GNSCC((Y, Z), E)), whereGNSCC((Y, Z), E)is the bipartite graph defined as follows:

To each strongly connected component of

scc[|XT|=1∧|ET U|=0](−→G(XT U, ET U)), which has not as successor or predecessor a vertex belonging to a strongly connected component of scc[|XT|≥1](−→G(XT U, ET U)), corresponds a vertex inY.

To each strongly connected component of−→G(XT U, ET U), which has an arc ingoing to or outgoing from a strongly connected component associated with an element ofY, corresponds a vertex ofZ.

Given a vertex y ∈Y and a vertex z∈Z,(y, z)∈E if and only if there is an arc between a vertex of the strongly connected component associated with Y and a vertex of the strongly connected component associated with Z in the digraph −→

G(XT U, ET U).

From Definition 5, h(GNSCC((Y, Z), E)) is the minimum number of elements of Z required to connect all elements ofY (i.e., the cardinality of a minimum hitting set).

Proof. First observe that two T-vertices that belong to two distinct strongly connected components of −→G(XT U, ET U) also belong to distinct strongly connected components of the final digraph Gf. Therefore NSCC

|scc[|XT|≥1](−→

G(XT U, ET U))|. Since in the final digraph any strongly connected component contains at least one arc, the T-vertices corresponding toX require to be linked to some additional strongly connected components. Then, by defini- tion of a minimum hitting set, the minimum number of such additional strongly

connected components ish(GNSCC((Y, Z), E)).

Example 10. Figure 5 illustrates Property 16 on the intermediate digraph

→G(XT U, ET U) depicted by Part (A). All the strongly connected components C1,

Références

Documents relatifs

The operator we are interested in is the graph translation [9] defined in the Fourier domain as an iso- metric operator shifting the Fourier components by a complex phase and

It can be observed that only in the simplest (s = 5) linear relaxation there is a small difference between the instances with Non-linear and Linear weight functions: in the latter

Anesthésie-Réanimation Cardiologie Anesthésie-Réanimation Ophtalmologie Neurologie Néphrologie Pneumo-phtisiologie Gastro-Entérologie Cardiologie Pédiatrie Dermatologie

Alternatively, using homogeneous Dirichlet and Neumann boundary conditions associated with an ensemble averaging over the SVEs leads to homogenised quantities with controlled

Given a subset of k points from S and a family of quadrics having d degrees of freedom, there exists a family of quadrics with d−k degrees of freedom that are passing through

3 is devoted to the results on the perturbation of a Gaussian random variable (see Section 3.1) and to the study of the strict positivity and the sect-lemma lower bounds for the

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des