Note that there are some explanatory texts on larger screens.

plurals
  1. POlpsolve solves the integer linear programming without meeting the given constraints
    text
    copied!<p>I am wondering whether any one here uses lpsolve to solve linear programming problem.</p> <p>I have defined a integer linear programming problem in a file where there is a constraint x45=0(there are also other integer variables). After the problem is solved by lpsolve, the result reported strangely is x45=1. However, if I put a label before the constraint, for example, c1:x45=0, then the constraint will be met. Anyone here know what's going on?</p> <p>So the problem I defined in my LP file is like:</p> <pre><code>max: 0 x0 262 x1 262 x2 262 x3 262 x4 262 x5 262 x6 262 x7 270 x8 0 x9 270 x10 270 x11 270 x12 270 x13 270 x14 270 x15; 549 x16 549 x17 0 x18 549 x19 549 x20 549 x21 549 x22 549 x23 &gt;= 1; 603 x24 603 x25 603 x26 0 x27 603 x28 603 x29 603 x30 603 x31 &gt;= 1; x0=0; x9=0; x18=0; x27=0; x36=0; x45=0; x54=0; x63=0; x0=x0; x1=x8; x2=x16; x3=x24; x4=x32; x5=x40; x6=x48; x7=x56; x8=x1; x9=x9; x10=x17; x11=x25; x12=x33; x13=x41; x14=x49; x15=x57; x16=x2; x17=x10; x18=x18; x19=x26; x20=x34; x21=x42; x22=x50; x23=x58; x24=x3; x25=x11; x26=x19; x27=x27; x28=x35; x29=x43; x30=x51; x31=x59; x32=x4; x33=x12; x34=x20; x35=x28; x36=x36; x37=x44; x38=x52; x39=x60; x40=x5; x41=x13; x42=x21; x43=x29; x44=x37; x45=x45; x46=x53; x47=x61; x48=x6; x49=x14; x50=x22; x51=x30; x52=x38; x53=x46; x54=x54; x55=x62; x56=x7; x57=x15; x58=x23; x59=x31; x60=x39; x61=x47; x62=x55; x63=x63; x0 x1 x2 x3 x4 x5 x6 x7=1; x8 x9 x10 x11 x12 x13 x14 x15=1; x16 x17 x18 x19 x20 x21 x22 x23=1; x24 x25 x26 x27 x28 x29 x30 x31=1; x32 x33 x34 x35 x36 x37 x38 x39=1; x40 x41 x42 x43 x44 x45 x46 x47=1; x48 x49 x50 x51 x52 x53 x54 x55=1; x56 x57 x58 x59 x60 x61 x62 x63=1; bin x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22,x23,x24,x25,x26,x27,x28,x29,x30,x31,x32,x33,x34,x35,x36,x37,x38,x39,x40,x41,x42,x43,x44,x45,x46,x47,x48,x49,x50,x51,x52,x53,x54,x55,x56,x57,x58,x59,x60,x61,x62,x63; </code></pre> <p>By solving it, the result is:</p> <pre><code>Value of objective function: 532.00000000 Actual values of the variables: x0 0 x1 0 x2 0 x3 0 x4 0 x5 0 x6 0 x7 1 x8 0 x9 0 x10 1 x11 0 x12 0 x13 0 x14 0 x15 0 x16 0 x17 1 x18 0 x19 0 x20 0 x21 0 x22 0 x23 0 x24 0 x25 0 x26 0 x27 0 x28 1 x29 0 x30 0 x31 0 x36 0 x45 1 x54 1 x63 0 x32 0 x40 0 x48 0 x56 1 x33 0 x41 0 x49 0 x57 0 x34 0 x42 0 x50 0 x58 0 x35 1 x43 0 x51 0 x59 0 x37 0 x44 0 x38 0 x52 0 x39 0 x60 0 x46 0 x53 0 x47 0 x61 0 x55 0 x62 0 </code></pre> <p>As you can see. x45 and x54 are both 1 while other constraints are all met. If I put a lable before the constraint such as : </p> <pre><code>c1: x45=0; </code></pre> <p>Then it will be met. I am not sure why this makes a difference</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload