Hello Malinee,

it would be helpful, if you could supply an example that creates the error.

From what I have understood you want to write something like:

set P1;
set P2;
set P3;
set P4;
var x2{p1 in P1, p2 in P2, P3, P4 : p1 <> p2} >= 0;
minimize obj :
  sum{p1 in P1, p2 in P2, p3 in P3, p4 in P4 : p1 <>p2}x2[p1,p2,p3,p4];
solve;
# output excluding p1 == p2
for {p1 in P1, p2 in P2, p3 in P3, p4 in P4 : p1 <> p2} {
  printf "x2[%d,%d,%d,%d]=%f\n",
     p1, p2, p3, p4, x2[p1,p2,p3,p4];
}
data;
set P1 := 1,2,3;
set P2 := 1,2;
set P3 := 4,5;
set P4 := 6,7;
end;

Best regards

Xypron


Malinee Wongruean wrote:
Please kindly help to correct the "post solving error" that occur after the program solve the 
model. The detail outcome was not came out ( I do the For loop in order to print it out). But for the 
objective value is came out just fine. I have 2 variables that I want to print it out so I use 2 lines of 
"printf" in the same For loop. Also there is out of domain error for one variable value for 
example I set the constrains for the variable: X2 p1,p2,p3,p4  where p1<>p2 but why the result 
still show the domain that p1 = p2 and that is the reason why the error has occurred.



_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to