help-glpk
[Top][All Lists]

## [Help-glpk] help solve a lp problem, please

 From: George Cao Subject: [Help-glpk] help solve a lp problem, please Date: Sat, 31 Jan 2004 22:24:30 -0800 User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4

```Hi everyone,

```
For the lp gurus in the group, can you guys take a look at this problem and see if you can provide some pointers?
```
maximize:
```
r1* x1a + r2 * x1b + r2*x2 (note: r1, r2 are constants and r2 is always greater than r1)
```
Subject to:
x1a + x1b <= d1
x2 <= d2
10 * x1b <= d1
x1a <= c1
x1b + x2 <= c2
x1a, x1b, x2 >=0

This works fine so far.  But I need to add a couple more constraints:
if (c1 - x1a - x1b) >= 0 let x1b = 0
if (c1 - x1a - x1b) < 0 x1b can be any number >= 0

```
I can't figure out how to incorporate these constraints into the lp problem. Adding (c1 - x1a - x1b) >= 1000000 * x1b works when (c1 - x1a - x1b) >= 0, but will make the whole problem not feasible when (c1 - x1a - x1b) < 0.
```