An Application of Combinatorial Optimization to the...

23
An Application of Combinatorial Optimization to the Structural Analysis of Differential-Algebraic Systems Mathieu Lacroix a,b , A. Ridha Mahjoub a , S´ ebastien Martin a a LAMSADE, Universit´ e Paris-Dauphine, Place du Mar´ echal De Lattre De Tassigny, 75775 Paris Cedex 16, France b LIMOS, Universit´ e Blaise Pascal Clermont-Ferrand II, Complexe Scientifique des ezeaux, 63177 Aubi` ere Cedex, France Abstract In this paper we consider the structural analysis problem for differential- algebraic systems with conditional equations. This problem consists, given a conditional differential algebraic system, in verifying if the system is well- constrained for every state, and if not to find a state in which the system is bad-constrained. We give a formulation for this problem as an integer linear program. This is based on a transformation of the problem to a matching problem in an auxiliary graph. We also show that the linear relaxation of that formulation can be solved in polynomial time. Using this, we develop a Branch-and-Cut algorithm for solving the problem and present some experi- mental results. Keywords: Differential algebraic system, structural analysis, graph, integer program, matching, Branch-and-Cut. 1. Introduction Differential-algebraic systems (DAS) are used for modeling complex phy- sical systems as electrical networks and dynamic mouvements. Such a system Email addresses: [email protected] (Mathieu Lacroix), [email protected] (A. Ridha Mahjoub), [email protected] (S´ ebastien Martin) Preprint submitted to Elsevier 14 d´ ecembre 2009

Transcript of An Application of Combinatorial Optimization to the...

Page 1: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

An Application of Combinatorial Optimization

to the Structural Analysis of Differential-Algebraic

Systems

Mathieu Lacroixa,b, A. Ridha Mahjouba, Sebastien Martina

aLAMSADE, Universite Paris-Dauphine, Place du Marechal De Lattre De Tassigny,75775 Paris Cedex 16, France

bLIMOS, Universite Blaise Pascal Clermont-Ferrand II, Complexe Scientifique desCezeaux,

63177 Aubiere Cedex, France

Abstract

In this paper we consider the structural analysis problem for differential-algebraic systems with conditional equations. This problem consists, givena conditional differential algebraic system, in verifying if the system is well-constrained for every state, and if not to find a state in which the system isbad-constrained. We give a formulation for this problem as an integer linearprogram. This is based on a transformation of the problem to a matchingproblem in an auxiliary graph. We also show that the linear relaxation ofthat formulation can be solved in polynomial time. Using this, we develop aBranch-and-Cut algorithm for solving the problem and present some experi-mental results.

Keywords: Differential algebraic system, structural analysis, graph, integerprogram, matching, Branch-and-Cut.

1. Introduction

Differential-algebraic systems (DAS) are used for modeling complex phy-sical systems as electrical networks and dynamic mouvements. Such a system

Email addresses: [email protected] (Mathieu Lacroix),[email protected] (A. Ridha Mahjoub), [email protected](Sebastien Martin)

Preprint submitted to Elsevier 14 decembre 2009

Page 2: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

can be given asF (x,x,u,p,t) = 0 (1)

where x is the variable vector, u is the input vector, p is the parameter vectorand t is time. As example, consider for instance the electrical circuit RL ofFigure 1. This network contains a coil L and a resistance R in series. Thevoltage U and current i at the terminal of the self are unknown.

Fig. 1 – Electrical circuit.

For this circuit we can associate the following differential system :

di

dt=

U

L,

E(t) = U + Ri,

where E(t) is a time function.Establishing that a DAS definitely is not solvable can be helpful. A neces-

sary (but not sufficient) criteria for solvability is that the number of variablesand equations must agree. Object-oriented modeling langages like Modelica[6] enforce this as simulation is not possible if this is not the case. Thus beforesolving a DAS, it is utile to verify if there are as many equations as variables,and if there exists a mapping between the equations and the variables in sucha way that each equation is related to only one variable and each variable isrelated to only one equation. If this is satisfied, then we say that the systemis well-constrained. Otherwise, the system is said to be bad-constrained. A

2

Page 3: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

bad-constrained system is also refered as structurally singular system. Thestructural analysis problem (SAP) of a DAS consists in verifying if the systemis well-constrained.

The structural analysis problem has been considered in the literature fornonconditional DASs. In [13, 14], Murota develops a graph theoretical me-thod for the structural analysis of a system of equations. He introduces aformulation of the problem in terms of bipartite graphs, and shows that asystem of equations is well-constrained if and only if there exists a perfectmatching in the corresponding bipartite graph. He also introduces graph de-composition techniques that permit to identify the well and bad-constrainedsubsystems. This reduces to decomposing the associated graph into strongconnected components. Such a decomposition can also be realized using thewell known Dulmage and Mendelsohn decomposition [3]. Murota also stu-died extensions of his approach and further aspects within the framework ofmatroids and matrices. In [17], Reibig and Feldmann propose a structuralmethod for solving DASs of the form

F (x,x) = f(t). (2)

which are generated from the description of electrical networks. The methodis based on graph and matroid theory. It permits to reduce the problem tothe determination of which is called a fundamental circuit of a matroid, indu-ced by a certain bipartite graph. Jian-Wan et al [9] and Nilsson [16] considerthe SAP in relation with Modelica models. A Modelica source code is firsttranslated into a so-called ”flat model” which is a system of equations of type1. In [9], the authors propose a method for analysing and detecting minimalbad-constrained subsystems. The method uses Dulmage et Mendelsohn de-composition techniques in a first step to isolate the bad-constrained subsetsof equations. Then for each such subsystem, a set of fictitious equations isformulated. These are related to the underlaying physical system. The resul-ting system of equations is in turn decomposed and so on until a minimalbad-constrained subsystem is detected. The method is applied in a recur-sive way until all the minimal bad-constrained components are localized. In[16], the author studies the SAP for modular systems of equations, that issystems which are constructed by composition of individual equation systemfragments. Leitold and Hangos [10] consider the DAS for dynamic processmodels. These are DAS which are sometimes difficult to solve numerically dueto index problems [1]. They propose a graph-theoretical method for analy-sing the differential index and the structural solvability of these models. The

3

Page 4: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

method is an extension of Murota’s approach [13], where a representationgraph is considered for each differential index.

To the best of our knowledge, the SAP has not been considered for DASwith conditional equations. This paper is concerned with this extension ofthe problem. The purpose of the paper is to propose a model and a resolutionapproach for the problem in this case.

The paper is organized as follows. In Section 2, we discuss the relationbetween DAS and matchings. In Section 3, we give a graph representation ofSAP for conditional DAS. An integer programming formulation is proposedin Section 4. A polynomial time algorithm for solving the linear relaxation ofthis formulation is discussed in Section 5. In Section 6 we devise a Branch-and-Cut algorithm based on these results and present some experimentalresults. And in Sections 7 and 8, we study an extension of our approach toDAS with embedded conditions.

2. Differential algebraic systems and matchings

A matching of a graph is a subset of edges such that no two edges sharea common node. Matchings have shown to be useful for modeling variousdiscrete structures [12]. A well known and widely studied problem in combi-natorial optimization is the matching problem. this consists, given a graphG = (V,E), in finding a matching with maximum cardinality [12],[4]. A graphis called bipartite if the vertices can be divided into two disjoint sets U andV such that every edge connects a node in U to one in V , that is, U andV are independent sets. A matching M of a bipartite graph G = (U ∪ V,E)such that |U | = |V | = n is called perfect if |M | = n. As mentioned above,the structural analysis of a DAS is a first and necessary step before analy-sing the system by simulating. The aim of this step is to find out whetherthe system is well-constrained. Given a DAS, one can associate a bipartitegraph G = (U ∪ V,E) where U corresponds to the equations, V to the va-riables, and there is an edge uivi ∈ E between a node ui ∈ U and a nodevi ∈ V if the variable corresponding to vi appears in the equation corres-ponding to ui. Graph G is called incidence graph. Therefore checking if thesystem is well-constrained can be realized by calculating a perfect matchingin the associated incidence graph. If such a matching does not exist, then theunderlaying DAS is bad-constrained [13].

Consider, for instance, the following DAS :

4

Page 5: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

eq1 : 0 = x + 4y,

eq2 : 0 = 2u + z + v,

eq3 : 0 = 3a + 3z + z,

eq4 : 0 = x + 4u, (3)

eq5 : 0 = 2w + v + y,

eq6 : 0 = 3w + 3u + z,

eq7 : 0 = 3a + 3u + w.

Let (14’) be the DAS obtained from (3) by replacing the equation eq6 bythe equation :

eq′6 : 0 = 3x + 3u.

The incidence graphs corresponding to DAS (3) and (14’) are shown inFigure 2 (a) and (b), respectively. Here nodes u1,...,u6,u

′6,u7 are associated

with equations eq1,...,eq6,eq′6,eq7 and nodes v1,...,v7 are associated with va-

riables a,u,v,w,x,y,z, respectively. A perfect matching is displayed in boldedges in Figure 2 (a), implying that system (14) is well-constrained. Howe-ver, the maximum matching of the incidence graph corresponding to system(3’), displayed in Figure 2 (b), is not perfect, which implies that system (3’)is bad-constrained.

For more details on the relation between simple (nonconditional) DASsand matchings see [13, 14].

3. The SAP for conditional DAS

In many practical situations, physical systems have different states ge-nerated by some technical conditions. These may be, for instance, relatedto temperature changements in hydraulic systems. These physical systemsgenerally yield DASs with conditional equations. Each conditional equationcan generate several equations. In this section we discuss the SAP for thesemore general DASs. We will suppose, without loss of generality, that theconditional equations of the system all generate the same number of equa-tions, for each combination of conditions. Otherwise, the system would be

5

Page 6: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

Fig. 2 – Incidence graphs.

bad-constrained. One can easily detect a conditional equation yielding lessor more variables than equations, if there is any. Moreover we will supposethat each conditional equation may generate only one equation. If this is notthe case then one can expand the system to a one satisfying this. In fact, if aconditional equation eqcond generates k equations with respect to a conditioncond, then it can be expanded to k conditional equations eq1,...,eqk such thateach equation eqi may generate the ith equation of eqcond according to condi-tion cond whether it is true or false. For example the conditional equation

if a > 0then

0 = 2x + y2,0 = x + y − 4,

else0 = x2 + y + 2,0 = 6x + y + 3,

can be expanded toif a > 0

then 0 = 2x + y2,else 0 = x2 + y + 2,

if a > 0then 0 = x + y − 4,else 0 = 6x + y + 3.

A conditional DAS may then have different forms depending on the setof conditions that hold each assignment. Here we consider conditional DASsuch that any conditional equation may take two possible values, depending

6

Page 7: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

on whether the associated condition is true or false and may generate onlyone equation. The equations generated by a conditional equation will be re-fered as simple equation. Each assignment of the values true and false to theconditions yield a nonconditional system, called a state of the system.

Consider for example the following DAS:

eq1 : if a > 0

then 0 = 4x2 + 2x + 4y + 2,

else 0 = y + 2z + 4,

eq2 : if b > 0

then 0 = 6y + 2z + 2, (4)

else 0 = x + y + 1,

eq3 : if c > 0

then 0 = 6x + y + 2,

else 0 = 3y + z + 3.

For conditions a > 0, b > 0, c > 0, system (4) is nothing but the following.

eq1 : 0 = 4x2 + 2x + 4y + 2,

eq2 : 0 = 6y + 2z + 2, (5)

eq3 : 0 = 6x + y + 2.

And conditions a > 0, b > 0, c ≤ 0 yield the system.

eq1 : 0 = 4x2 + 2x + 4y + 2,

eq2 : 0 = 6y + 2z + 2, (6)

eq3 : 0 = 3y + z + 3.

Figure 3 shows the incidence bipartite graphs for systems (5) and (6).So given a conditional DAS, the associated SAP consists in verifying

whether the system is well-constrained in any state, and if not, in finding astate in which the system is bad-constrained. The SAP for a conditional DASthus reduces to verifying whether or not the bipartite graph related to anystate of the system contains a perfect matching. A difficulty arises here is thatthe number of possible states may be exponential. So the approaches usedso far for simple DASs cannot, unfortunately, be applied for that problem. A

7

Page 8: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

Fig. 3 – Incidence graphs.

more efficient method is this needed for solving it. In the rest of this section weshall discuss a graph based model for the problem. Given a conditional DASwith n equations, say eq1,...,eqn, and n variables, say x1,...,xn, we consider abipartite graph G = (U ∪ V,E) where U = {u1,...,un} (resp. V = {v1,...,vn})is associated with the equations (resp. variables). Between a vertex ui ∈ Uand a vertex vj ∈ V we consider an edge, called true edge (resp. false edge), ifthe variable xj appears in equation eqi, when the condition of eqi is supposed

true (resp. false). Let Eti (resp. Ef

i ) be the set of true (resp. false) edgesincident to ui, for all i = 1,...,n. Let

E =⋃

i=1,...,n

(Eti ∪ Ef

i ).

Figure 4 shows the graph G associated with system (4).Now, the SAP reduces to finding whether or not there exists a subgraph

of G, say G′, containing, for each node ui, either Eti or Ef

i , and which doesnot have a perfect matching. We will refer to this problem as the free perfectmatching subgraph problem (FPMSP). In the following section we will discussan integer programming formulation for this problem.

4. Formulation

Integer programming [8] is one of the powerful tools of mathematicalprogramming and combinatorial optimization. Several problems from variousdomains can be formulated as integer programs. Effective methods have beendeveloped for formulating, analysing and solving these problems. In what

8

Page 9: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

Fig. 4 – Graph representing system (4).

follows we will propose an integer programming based model for the FPMSP,and thus for the underlaying SAP.

With a vertex ui ∈ U let us associate a binary variable x(ui) which takes1 if Et

i is contained in G′ and 0 if Efi is contained in G′, that is, x(ui) = 1 if

the condition of equation eqi is true and 0 if not.Let M be a perfect matching of G. Let x ∈ {0,1}U such that x(ui) = 1 if

M ∩ Eti 6= ∅ and x(ui) = 0 if M ∩ Ef

i 6= ∅, that is subgraph G′ induced by xcontains a perfect matching. Therefore x satisfies the following equation

uivj∈M∩Eti

x(ui) +∑

uivj∈M∩Efi

(1− x(ui)) = n.

Thus, by considering the following constraint, one can discard this non fea-sible solution.

uivj∈M∩Eti

x(ui) +∑

uivj∈M∩Efi

(1− x(ui)) ≤ n− 1.

In consequence, the FPMSP is equivalent to the following integer program.

max 0x∑

uivj∈M∩Eti

x(ui) +∑

uivj∈M∩Efi

(1− x(ui)) ≤ n− 1

for all M ∈M, (7)

0 ≤ x(ui) ≤ 1, for all ui ∈ U , (8)

x(ui) ∈ {0,1}, for all ui ∈ U . (9)

9

Page 10: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

Here M is the set of perfect matchings.Indeed, FPMSP has a ”yes” answer, that is the underlaying DAS is well-

constrained, if and only if, the program above has no a feasible solution.We will denote the program above by (P ). Hence, in order to solve FPMSP,one can use integer programming tools for solving (P ). One of the powerfultechniques in integer programming and combinatorial optimization is theso called polyedral approach. This consists in reducing the resolution of theprogram to a sequence of linear programs. This approach is based on a deepinvestigation of the convex hull of the solutions of the problem.

A drawback of the program (P ) is that the polyhedron given by inequali-ties (7)-(9) may be empty (if the system is well-constrained). The polyhedralapproach based on that model, would not then be appropriate. In order toavoid this situation and always work with a feasible program, we are goingto slightly modify program (P ). Consider the following program (Q), wherey is a new non-negative variable.

min y∑

uivj∈M∩Eti

x(ui) +∑

uivj∈M∩Efi

(1− x(ui))− y ≤ n− 1

for all M ∈M, (10)

0 ≤ x(ui) ≤ 1, for all ui ∈ U , (11)

0 ≤ y, (12)

x(ui) ∈ {0,1}, for all ui ∈ U . (13)

Clearly, x is a solution of (P ) if and only if (x,0) is a solution of (Q).Thus in order to solve problem (P ), one can solve problem (Q). If (x,y)is an optimal solution of (Q) with y 6= 0, then the system in question iswell-constrained for all states, and if y = 0 then the state induced by x isbad-constrained. Inequalities (10) will be called matching inequalities.

As in program (P ), the number of inequalities in (Q) may be exponential.In order to solve (Q) using a polyhedral approach, one needs an efficientalgorithm for separating inequalities (10). In the following section we devisea polynomial time separation algorithm for these inequalities.

5. Separation

The separation problem for inequalities (10) consists, given a solution(x∗,y∗) ∈ RU

+ × R+, to determine whether (x∗,y∗) satisfies inequalities (10),

10

Page 11: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

and if not to find an inequality violated by (x∗,y∗). An algorithm whichsolves this problem is called a separation algorithm. Since inequalities (10)are in exponential number in program (Q), the separation algorithm is akey ingredient for being able to use these inequalities inside a cutting planealgorithm. In what follows, we will give a polynomial time separation al-gorithm for these inequalities. From the equivalence between separation andoptimization in combinatorial optimization [8], this will imply that the linearrelaxation of problem (Q) can be solved in polynomial time.

Let (x∗,y∗) ∈ RU+ × R+. With an edge uivj ∈ E associate the weight

w(uivj) given by

w(uivj) =

1 if uivj ∈ Eti ∩ Ef

i ,

1− x∗(ui) if uivj ∈ Efi ,

x∗(ui) if uivj ∈ Eti .

If the maximum weight of a perfect matching M in G, with respect tothese weights, is greater than y∗ + n − 1, then the inequality of type (10),corresponding to M , is violated. Otherwise, all the inequalities of type (10)are satisfied.

For instance, consider, system (4) and the solution x∗(u1) = 0,7, x∗(u2) =0,4, x∗(u3) = 0,3, y∗ = 0,2. Therefore we associate with the edges of thecorresponding bipartite graph in Figure 4 the following weights w(u1v1) =0.7, w(u1v3) = 0.3, w(u2v1) = 0.6, w(u2v3) = 0.4, w(u3v1) = 0.3, w(u3v3) =0.7, w(u1v2) = w(u2v2) = w(u3v3) = 1. The maximum perfect matching withrespect to w is {u1v1, u2v2, u3v3} with w(M) = 2.4. As y∗ + n − 1 = 2.2,w(M) > y∗ + n − 1. Since u1v1 ∈ Et

1, u2v2 ∈ Et2 ∩ Ef

2 , u3v3 ∈ Ef3 , we have

that the inequality

x(u1) + x(u2) + 1− x(u2) + 1− x(u3)− y ≤ 2

is violated, with respect to (x∗,y∗).

Thus, the separation problem for inequalities (10) reduces to computinga maximum weight perfect matching in a bipartite graph. Moreover, this canbe solved in polynomial time [12].

6. Branch-and-Cut algorithm

Branch-and-Cut methods are very powerful techniques for solving hardinteger programming and combinatorial optimization problems. These me-

11

Page 12: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

thods consist of a combination of a cutting plane technique and a Branch-and-Bound algorithm. In this section, we present a Branch-and-Cut algorithm forthe SAP for conditional DAS. Our aim is to address the algorithmic appli-cations of the model and the theoretical results presented in the previoussections. To start the optimization, we consider the following linear programgiven by the trivial inequalities, that is

min y

0 ≤ x(ui) ≤ 1, for all ui ∈ U ,

0 ≤ y.

An important task in the Branch-and-Cut algorithm is to determine whe-ther or not an optimal solution of the linear relaxation of the SAP is feasible.An optimal solution (x,y) of the linear relaxation is feasible for the SAP if xis integer and (x,y) satisfies the matching inequalities. Thus verifying if (x,y)is feasible for SAP can be done in polynomial time. Note that if x is integer,then y is also integer. If an optimal solution (x,y) of the linear relaxation ofthe SAP is not feasible, the Branch-and-Cut algorithm generates a matchinginequality that is valid for our problem and violated by (x,y). We remarkthat all inequalities are global (i.e. valid in all the Branch-and-Cut tree).Our separation algorithm is applied on the graph G weighted by the currentLP-solution (x,y).

To store the generated inequalities, we create a pool whose size increasesdynamically. All the generated inequalities are put in the pool and are dy-namic, i.e. they are removed from the current LP when they are not active.We first separate inequalities from the pool. If all the inequalities in thepool are satisfied by the current LP-solution, then we separate the matchinginequalities.

The Branch-and-Cut algorithm has been implemented in C++, usingABACUS [5] library to manage the Branch-and-Cut tree and CPLEX 11.0as LP-solver. To separate inequalities (10), we use Galil, Micali, and Gabowalgorithm [7] for solving the maximum weighted perfect matching. This al-gorithm runs in O(nmlog(n)) time where n is the number of nodes and mthe number of edges of the graph. Actually we use the version implementedin Lemon Graph Library [11].

The algorithm was tested on a Pentium core 2 duo 2,66 GHz with 2GORAM. We fixed the maximum CPU time to 1 hour. Results are presentedhere for randomly generated instances and realistic instances. For randomly

12

Page 13: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

instances, tests were performed for systems with up to n = 70 equations.(Recall that the corresponding bipartite graphs have 2n nodes). The systemsare considered in such a way that they respect a certain density in the as-sociated graph. For each instance we fix the maximum number of variablesthey may appear in any equation. This corresponds to the maximum degreein the associated graph. Tests were performed for densities between 5 and25. Five instances were tested for each problem.

The results are given in Tables 1 and 2. Table 1 reports the average resultsobtained for the randomly generated problems, while Table 2 presents theresults for the realistic ones.

13

Page 14: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

The entries in the tables are :n : the number of equations,Density : the number of variables in each equation,o/p : the number of problems solved to optimality over

the number of instances tested,CPU : the total time in second,No : the number of generated nodes

in the Branch-and-Cut tree,Match : the number of generated matching inequalities,Gap : the gap between the optimal value and the lower bound

obtained at the root node of the Branch-and-Cut tree.

From Table 1, summarizing the results for the random instances, it ap-pears that the resolution time increases with the size of the instances. It alsoappears that the time strongly depends on the density of the incidence graph.For instance, for the problems with n = 35 equations and a density equalsto 5, all the instances have been solved to optimality. Whereas for the sameinstances with a density greater than or equals to 15, none of the instanceshave been solved in the time limit. This may explained by the fact that whenthe density is high, the associated graph is quite dense, and hence containsmore perfect matchings. In consequence, verifying if there is a configurationof the system which does not yield a perfect matching, may need a lot oftime. However when the graph is sparse, this can be done much faster. Wealso remark that a significant number of matching inequalities have been ge-nerated for most of the instances with 30 equations and more.

The instances of Table 2 correspond to realistic systems having between51 and 255 equations, with small density of variables. These have been mucheaser to solve. In fact as it appears from the table, all the instances havebeen solved to optimality, except that with 255 equations. Also we remark,that as for the random instances, a big number of matching inequalities havebeen generated for all the large instances. Finally we observe that in contrastof the random instances, the algorithm generates much more nodes in theBranch-and-Cut tree.

14

Page 15: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

n Density o/p CPU No Match Gap20 5 5/5 0 1 20,4 020 10 5/5 3,6 18,2 625,8 0,6620 15 5/5 3,4 7 444,2 0,6720 20 5/5 2,6 15,4 359 0,6525 5 5/5 0,2 1,4 13,6 025 10 5/5 0 1 1,8 025 15 5/5 13,8 18,2 1201,4 0,2925 20 5/5 29,2 73,4 2189 0,6530 5 5/5 8,4 6,6 1079,6 030 10 4/5 1340 129,4 98373,8 0,5430 15 4/5 2071,8 99,8 130632 0,6730 20 3/5 1826,6 55,8 99637,4 0,6330 25 2/5 2884,6 46,6 142051,2 0,3335 5 5/5 4,8 1 720,75 035 10 2/5 2643,4 12,6 134868 0,4435 15 0/5 3654,6 1 162749,2 -40 5 5/5 14 1 932 040 7 4/5 883,8 1 36967,8 040 9 3/5 1694,2 1 61363,8 045 5 5/5 55 1,4 2112,6 045 7 3/5 2099,4 1 57603,2 045 9 0/5 3641,2 1 100906,8 -50 5 5/5 62,8 1 2079,4 050 7 5/5 1312,8 1 28117,4 050 9 1/5 3068,4 1 61452,6 055 5 5/5 628,6 1 11635,2 055 7 0/5 3629 1 56792,6 -55 9 0/5 3629 1 55639,2 -60 5 5/5 558,8 1 8736,8 060 7 2/5 3003,8 1 35038,6 060 9 0/5 3625,6 1 42140,6 -65 5 4/5 1520,4 1 34944 065 7 0/5 3626 1 34064,6 -65 9 0/5 3624 1 35083,5 -70 5 2/5 1819,5 1 25240 070 7 0/5 3620,5 1 29590,5 -70 9 0/5 3620 1 29768 -

Tab. 1 – Randomly generated instances

15

Page 16: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

n Density CPU No Match Gap51 2-3 0 1 1 075 2-3 3 63 32 181 2-3 0 1 1 0

111 2-3 7 510 256 1135 2-3 33 2047 1024 1159 2-3 227 8190 4096 1183 2-3 2399 32766 16384 1255 2-3 3798 26945 13478 -

Tab. 2 – Realistic instances.

7. Extension : DASs with embedded conditions

The approach developed above can be extended for integrating embeddedconditions. DASs with embedded conditions are more complex to handle. Inthis section we discuss this generalization.

16

Page 17: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

Consider for example the following DAS.

eq1 : if a > 0

then

if b > 0

then 0 = y,

else 0 = 3x,

else

if c > 0

then 0 = 3z + y,

else 0 = v,

eq2 : if d > 0

then

if e > 0 (14)

then 0 = 4y + x,

else 0 = z,

if f > 0

then 0 = x,

else 0 = v + z,

else 0 = x + v + 1,

0 = v + y + 1,

eq3 : if a > 0

then 0 = 6x + 2,

else 0 = 3y + z + 3 + v.

17

Page 18: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

Observe that eq2 can be decomposed into two sub-equations :

eq′2 : if d > 0

then

if e > 0

then 0 = 4y + x,

else 0 = z,

else 0 = x + v + 1,

eq′′2 : if d > 0

then

if f > 0

then 0 = x,

else 0 = v + z,

else 0 = v + y + 1.

Therefore, system (14) can be expressed by (eq1,eq′2,eq

′′2 ,eq3) Thus any

conditional equation of a DAS with embedded conditions may decomposeinto smaller conditional sub-equations. In the sequel we consider systemsthat are minimal, that is to say in which the conditionals equations cannotdecompose anymore. As for the non-embedded DAS, we suppose that eachconditional equation generates the same number of simple equations for eachcombination of conditions. We also suppose, without loss of generality, thatevery conditional equation, may generate exactly one simple equation. Givena DAS with embedded equations we will call combination of conditions anyassignment of the values true and false to the conditions of an equation ofthe system. By our hypothesis any combination of condition yields only onesimple equation.

For instance, in system (14), the equation 0 = y in eq1 is the result ofthe combination {a > 0,b > 0} and 0 = v + z in eq′′2 is the result of thecombination {d > 0,f ≥ 0}. Let C1,...,Cm be the possible combinations ofconditions. Remark that the number of combinations Ck is polynomial in thesize of the system (number of simple equations and variables).

For system (14), we have the following combinations : C1 = {a > 0,b > 0}, C2 ={a > 0, b ≤ 0}, C3 ={a ≤ 0, c > 0}, C4 ={a ≤ 0, c ≤ 0},

18

Page 19: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

C5 ={d > 0, e > 0}, C6 ={d > 0, e ≤ 0}, C7 ={d > 0, f > 0}, C8 ={d > 0,f ≤ 0}, C9 =d ≤ 0, C10 =a > 0 and C11 =a ≤ 0. For i = 1,...,m, letRi be the set of combinations of conditions that are implied by Ci, that isthe combinations that are satisfied if Ci so is. For instance, for the exampleabove, C10 = {a > 0} is implied by C1 = {a > 0,b > 0}. For i = 1,...,m, letTi be the set of combinaisons Cj which are incompatible with Ci, that is Ci

and Cj cannot occur at the same time. For the example above C2 and C4 areincompatible.

Consider the bipartite graph G = (U∪V,E) where U = {u1,...,un} corres-ponds to the conditional equations of the system, V = {v1,...,vn} correspondsto the variables, and we consider an edge uivi between two nodes ui ∈ U andvi ∈ V if the variable vi appears in a simple equation that may be generatedby the conditional equation corresponding to ui, when a combination Ck ofconditions holds.

Let Ek be the set of edges implied by combinations Ck, for k = 1,...,n.Thus

E =⋃

k=1,...,m

Ek.

For system (14), the edge sets Ek, generated by combination C1,...,C11,are E1 = { u1v2 }, E2 = { u1v1 }, E3 = { u1v3, u1v2 }, E4 = { u1v4 }, E5 ={ u2v2, u2v1 }, E6 = { u2v3 }, E7 = { u3v1 }, E8 = { u3v4, u3v3 }, E9 = {u2v1, u2v4, u3v4, u3v2 }, E10 = { u4v1 } and E11 = { u4v2, u4v3, u4v4 }. Andthe incidence graph is given in Figure 5. Note that nodes u2, u3 correspondto the conditional equations eq′2, eq′′2 . The number on each edge correspondsto the set Ek to which belongs the edge.

Thus the DAS is bad-constrained if and only if there exists a family Fof sets Ek whose edges cover the nodes of U and such that the subgraphinduced by these edges does not contain a perfect matching. Moreover, Fmust satisfy the following :a) if Ei,Ej ∈ F , then Ci and Cj are compatible, andb) if Ei ∈ F and Cj ∈ Ri, then Ej ∈ F .One can easily verify, for graph G of Figure 5 that the sets E1,E6,E7,E10

constitute a feasible family that covers the nodes u1,...,u4 and verifies theconditions a), b) above. However the subgraph induced by there sets doesnot contain a perfect matching. In consequence, the family of conditionsC1,C6,C7,C10 induces a bad-constrained system. Given a DAS with embed-

19

Page 20: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

Fig. 5 – Graph G.

ded conditions we will call state of the system any set of combinations Ci

covering all the equations of the system and whose edge sets Ei verify condi-tions a), b) above.

As for the DASs studied in the previous section, the problem here isto find a state in which the system is bad-constrained or to show that thesystem is well-constrained in any state. So in graph G this consists in finding asubgraph induced by a state of the system which does not contain a perfectmatching, or to show that for any state the corresponding graph containssuch a matching.

8. Formulation

With every set of edges Ei we associate a binary variable xi such thatxi = 1 if Ci is considered in the state of the system and xi = 0 if not. Clearly,if x represents a state of the system, then x satisfies the following inequalities

xi + xk ≤ 1, for all k ∈ Ri, for i = 1,...,n,

xk ≤ xi, for all k ∈ Ti, for i = 1,...,n.

20

Page 21: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

Moreover if M is a perfect matching of G, then x satisfies the equation

m∑j=1

|Ej ∩M | xj = n.

Thus, by considering the following constraint, one can discard this solution.

m∑j=1

|Ej ∩M | xj ≤ n− 1.

Consider the following integer program (P ).

max y (15)m∑

j=1

|Ej ∩M | xj ≤ n− 1, for all M ∈M, (16)

xi + xk ≤ 1, for all k ∈ Ri, (17)

xk ≤ xi, for all k ∈ Ti, (18)∑i=1,...,n

Ek∩ δ(ui) 6=∅

xk ≥ y, for all ui ∈ U , (19)

0 ≤ xk ≤ 1, for all Ek ∈ E, (20)

0 ≤ y, (21)

xk ∈ {0,1}, for all Ek ∈ E. (22)

We claim that the SAP is equivalent to program (P ). In fact, let (x,y) be

a solution of (P ). If y ≥ 1, then by constraints (19) each node of U hasat least one incident edge in the bipartite graph induced by x. As this sub-graph does not contain a perfect matching, this implies that the system isbad-constrained. If y < 1, as the program is to maximize y, there should notexist a state of the system such that the corresponding edge sets Ei coverthe nodes of U and do not induce a perfect matching. This implies that thesystem is well-constrained. Clearly, constraints (17)-(21) can be separated inpolynomial time (by enumeration). For constraints (16), the separation pro-blem can be solved to the maximum weight matching problem in a bipartitegraph.

21

Page 22: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

9. Concluding remarks

In this paper we have studied the SAP for conditional DASs. We haveproposed integer programming formulations for the problem for both the em-bedded and nonembedded cases. We have shown that the linear relaxationsof these models can be solved in polynomial time. Based on the formulationfor the non-embedded version, we have developed a Branch-and-Cut algo-rithm for solving the problem in this case and presented some computationalresults. These show that the difficulty of the problem strongly depends onthe density of the incidence graph. They also show that the linear relaxationof the problem is not so tight. Further valid inequalities are needed to morestrengthen the linear relaxation. For this a deep investigation of the associa-ted polytope would be necessary. This is one of the directions of our futurresearch. A second direction is to develop a Branch-and-Cut algorithm forthe embedded case. Here the problem is much harder. However, our polyhe-dral investigation for the nonembedded problem would be very helpful forthe embedded one.

Acknowledgments

We would like to thank Sebastien Furic, Bruno Lacabanne and El DjillaliTalbi from LMS-Imagine for stimulating discussions. This work has been sup-ported by the project ANR-06-TLOG-26-01 PARADE. The financial supportis much appreciated.

[1] K. E. Brenan, S. L. Campbel & L. R. Petzold. (1989). Numerical solutionof initial value problems in differential-algebraic equations. New York:North-Holland.

[2] I. Duff. (1972). Analysis of sparse systems. Ph.D. thesis. Oxford univer-sity.

[3] A. L. Dulmage & N. S. Mendelsohn. (1963). Coverings of bipartitegraphs. Canadian Journal of Mathematics, pp. 517-534.

[4] J. Edmonds. (1965). Maximum matching and a polyhedron with 0,1-vertices. J. Res. Nat. Bur. Standards, 69B, pp. 125-130.

[5] M. Elf, C. Gutwenger, M. Junger & G. Rinaldi. (2001). Branch-and-CutAlgorithms for Combinatorial Optimization and Their Implementationin ABACUS. Computational Combinatorial Optimization, Springer, pp.157-222.

22

Page 23: An Application of Combinatorial Optimization to the ...lacroix/Documents/Papiers/articleCIE.pdfIntroduction Difierential-algebraic systems (DAS) are used for modeling complex phy-

[6] P. Fritzson. (2003). Principles of Obeject-Oriented Modeling and Simu-lation with Modelica 2.1. Wiley-Interscience.

[7] Z. Galil, S. Micali & H. N. Gabow. (1986). An O(EV log V) algorithmfor finding a maximal weighted matching in general graphs. SIAM J.Computing, 15:120 - 130.

[8] M. Grotschel, L. Lovasz & A. Schrijver. (1981). The ellipsoid methodand its consequences in combinatorial optimization. Combinatorica, pp.169-197.

[9] D. Jian-Wan, C. Li-Ping, Z. Fan-Li, W. Yi-Zhong & W. Guo-Biao.(2006). An Analyzer for Declarative Equation Based Models. Modelica2006, pp. 349-357.

[10] A. Leitold & K. M. Hangos. (2001). Structural solvability analysis ofdynamic process models. Computeurs and Chemical Engineering 25, pp.1633-1646.

[11] Lemon Graph Library. https://lemon.cs.elte.hu/trac/lemon.

[12] L. Lovasz & M. D. Plummer. (1986). Matching Theory. North-Holland.

[13] K. Murota. (1987). Systems Analysis by Graphs and Matroids. Springer-Verlag.

[14] K. Murota. (2000). Matrices and Matroids for Systems Analysis.Springer-Verlag.

[15] G. L. Nemhauser & L. A. Wolsey. (1988). Integer and CombinatorialOptimization. A Wiley-Interscience Publication.

[16] H. Nilsson. (2008). Type-Based Structural Analysis for Modular Sys-tems of Equations. Proceedings of the 2nd International Workshop onEquation-Based Object-Oriented Languages and Tools, pp. 71-81.

[17] G. Reibig & U. Feldmann. (2002). A simple and general method fordetecting structural inconsistencies in large electrical networks. Circuitsand Systems I: Fundamental Theory and Applications, pp. 237-240.

[18] J. Unger, A. Kroner & W. Marquardt. (1995). Structural analysis ofdifferential-algebraic equation systems - theory and application. Com-puteurs and Chemical Engineering, pp. 867-882.

23