|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Binary and integer variables in IDE 5.5.0.15Dears:
lp_solve IDE 5.5.0.15 is "Ignoring integer restrictions" when solving the following very simple problem: /* Example with binary variable */ /* Very simple example of a farm with a machine with P1 = 10000 (fixed cost) and P2 = 20 (variable cost) */ MAX: -10000 P1 - 20 P2 + 250 P3 + 200 P4 + 150 P5; /* Constraints */ Land: P3 + P4 + P5 <= 300; Labor: 6 P3 + 4 P4 + 3 P5 <= 2400; Capital: 125 P3 + 60 P4 + 35 P5 <= 40000; MachUse: -1.2 P2 + P3 + P4 + P5 <= 0; MaxUse: -700 P1 + P2 <= 0; /* P1 is a binary variable */ bin P1; Log: Ignoring integer restrictions Model name: 'LPSolver' - run #1 Objective: Maximize(R0) SUBMITTED Model size: 5 constraints, 5 variables, 15 non-zeros. Sets: 0 GUB, 0 SOS. Using DUAL simplex for phase 1 and PRIMAL simplex for phase 2. The primal and dual simplex pricing strategy set to 'Devex'. Optimal solution 66428.5714286 after 3 iter. Excellent numeric accuracy ||*|| = 0 MEMO: lp_solve version 5.5.0.15 for 32 bit OS, with 64 bit REAL variables. In the total iteration count 3, 0 (0.0%) were bound flips. There were 0 refactorizations, 0 triggered by time and 0 by density. ... on average 3.0 major pivots per refactorization. The largest [LUSOL v2.2.1.0] fact(B) had 6 NZ entries, 1.0x largest basis. The constraint matrix inf-norm is 700, with a dynamic range of 700. Time to load data was 0.000 seconds, presolve used 0.000 seconds, ... 0.016 seconds in simplex solver, in total 0.016 seconds. I get the same result if I use int in place of bin. Version 5.5.0.14 solved correctly the same problem with int, but not with bin. In version 5.5.0.15 other problems with int were also solved "Ignoring integer restrictions". What am I doing wrong? Many thanks in advance for your answers. Rodolfo |
|
|
Re: Binary and integer variables in IDE 5.5.0.15There is a checkbox in the options tab of the IDE to ignore integer restrictions...
Peter --- In lp_solve@..., "rodolfofrank" <rodolfofrank@...> wrote: > > Dears: > > lp_solve IDE 5.5.0.15 is "Ignoring integer restrictions" when solving the following very simple problem: > > /* Example with binary variable */ > /* Very simple example of a farm with a machine with P1 = 10000 (fixed cost) and P2 = 20 (variable cost) */ > MAX: -10000 P1 - 20 P2 + 250 P3 + 200 P4 + 150 P5; > /* Constraints */ > Land: P3 + P4 + P5 <= 300; > Labor: 6 P3 + 4 P4 + 3 P5 <= 2400; > Capital: 125 P3 + 60 P4 + 35 P5 <= 40000; > MachUse: -1.2 P2 + P3 + P4 + P5 <= 0; > MaxUse: -700 P1 + P2 <= 0; > /* P1 is a binary variable */ > bin P1; > > > Log: > > Ignoring integer restrictions > Model name: 'LPSolver' - run #1 > Objective: Maximize(R0) > SUBMITTED > Model size: 5 constraints, 5 variables, 15 non-zeros. > Sets: 0 GUB, 0 SOS. > Using DUAL simplex for phase 1 and PRIMAL simplex for phase 2. > The primal and dual simplex pricing strategy set to 'Devex'. > Optimal solution 66428.5714286 after 3 iter. > Excellent numeric accuracy ||*|| = 0 > MEMO: lp_solve version 5.5.0.15 for 32 bit OS, with 64 bit REAL variables. > In the total iteration count 3, 0 (0.0%) were bound flips. > There were 0 refactorizations, 0 triggered by time and 0 by density. > ... on average 3.0 major pivots per refactorization. > The largest [LUSOL v2.2.1.0] fact(B) had 6 NZ entries, 1.0x largest basis. > The constraint matrix inf-norm is 700, with a dynamic range of 700. > Time to load data was 0.000 seconds, presolve used 0.000 seconds, > ... 0.016 seconds in simplex solver, in total 0.016 seconds. > > I get the same result if I use int in place of bin. > > Version 5.5.0.14 solved correctly the same problem with int, but not with bin. In version 5.5.0.15 other problems with int were also solved "Ignoring integer restrictions". > > What am I doing wrong? > > Many thanks in advance for your answers. > > Rodolfo > |
| Free embeddable forum powered by Nabble | Forum Help |