help-glpk
[Top][All Lists]

## Re: [Help-glpk] Subject to two conditions

 From: João Vilela Subject: Re: [Help-glpk] Subject to two conditions Date: Wed, 10 Nov 2010 16:29:14 +0000 User-agent: Mozilla/5.0 (X11; U; Linux i686; pt-PT; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6

True! I've tested it and values that are too large spoil the picture. But with more reasonable values it works like a charm.
```
João

Em 10/11/10 16:00, Michael Hennebry escreveu:
```
```On Wed, 10 Nov 2010, Suleyman Demirel wrote:

```
```Usually, if you have an either/or constraint, you should define a binary
```
variable, say y, taking only 0-1 value. If y=0, the sum is less than zero,
```if y=1, the sum is greater than two.

Let M be a very large number (M=100000000000).Then, you should have two
constraints as follows.
```
```
Nyet.
M should be the smallest value which will work.
Merely large values give loose constraints.
Truly huge values can cause numerical difficulties.

```
```s.t. condition1{(i,j) in E}: (sum{(i,j,i1,j1) in L} x2[i1,j1] <=M *y;
```
```
Each of the above M's should at most be an upper
bound on the corresponding sum on the left.

```
```s.t. condition1{(i,j) in E}: (sum{(i,j,i1,j1) in L} x2[i1,j1] >=2*y - M
*(1-y)
```
```
Each of these M's should be at most an upper bound on
the negative of the corresponding sum on the left.

```
```

```