how to define integer polytope by matrix representation
Posted: 26 Sep 2021, 13:25
Dear support team,
First, thanks for your useful tool. I am trying to define a polyhedron (actually, integer polytope) by using "https://shell.polymake.org/".
I would like to represent the polyhedron of the GAP (generalized assignment problem) that is defined by the following constraints:
// CPLEX lp format
Minimize
obj: x1
Subject To
e1: x1 - 9 b2 - 2 b3 - b4 - 2 b5 - 3 b6 - 8 b7 = 0
e2: b2 + b3 = 1
e3: b4 + b5 = 1
e4: b6 + b7 = 1
e5: 6 b2 + 7 b4 + 9 b6 <= 13
e6: 8 b3 + 5 b5 + 6 b7 <= 11
Bounds
x1 Free
0 <= b2 <= 1
0 <= b3 <= 1
0 <= b4 <= 1
0 <= b5 <= 1
0 <= b6 <= 1
0 <= b7 <= 1
Binaries
b2 b3 b4 b5 b6 b7
End
//
What I am trying to do is based on the matrix generation form as:
$inequalities=new Matrix<Integer>([
[1,-1,-1,0,0,0,0],
[1,0,0,-1,-1,0,0],
[1,0,0,0,0,-1,-1],
[13,-6,0,-7,0,-9,0],
[11,0,-8,0,-5,0,-6],
[-1,1,1,0,0,0,0],
[-1,0,0,1,1,0,0],
[-1,0,0,0,0,1,1]]);
$p=new Polytope<Rational>(INEQUALITIES=>$inequalities);
print_constraints($p->INEQUALITIES);
It seems to work but I was wondering if,
1- Is there any simple way to define equality constraints instead of their corresponding inequalities?
2- How we can invoke the extreme points of the polyhedron? (is it: print $p->VERTICES;)
3- As my problem is an optimization program (BIP) what is the best way to use the "$f = lp2poly" method inside of the "https://shell.polymake.org/"? if not, is there any alternative? (to clear: is there any way to define a MILP by the above matrix form?)
Best regards
Abbas
First, thanks for your useful tool. I am trying to define a polyhedron (actually, integer polytope) by using "https://shell.polymake.org/".
I would like to represent the polyhedron of the GAP (generalized assignment problem) that is defined by the following constraints:
// CPLEX lp format
Minimize
obj: x1
Subject To
e1: x1 - 9 b2 - 2 b3 - b4 - 2 b5 - 3 b6 - 8 b7 = 0
e2: b2 + b3 = 1
e3: b4 + b5 = 1
e4: b6 + b7 = 1
e5: 6 b2 + 7 b4 + 9 b6 <= 13
e6: 8 b3 + 5 b5 + 6 b7 <= 11
Bounds
x1 Free
0 <= b2 <= 1
0 <= b3 <= 1
0 <= b4 <= 1
0 <= b5 <= 1
0 <= b6 <= 1
0 <= b7 <= 1
Binaries
b2 b3 b4 b5 b6 b7
End
//
What I am trying to do is based on the matrix generation form as:
$inequalities=new Matrix<Integer>([
[1,-1,-1,0,0,0,0],
[1,0,0,-1,-1,0,0],
[1,0,0,0,0,-1,-1],
[13,-6,0,-7,0,-9,0],
[11,0,-8,0,-5,0,-6],
[-1,1,1,0,0,0,0],
[-1,0,0,1,1,0,0],
[-1,0,0,0,0,1,1]]);
$p=new Polytope<Rational>(INEQUALITIES=>$inequalities);
print_constraints($p->INEQUALITIES);
It seems to work but I was wondering if,
1- Is there any simple way to define equality constraints instead of their corresponding inequalities?
2- How we can invoke the extreme points of the polyhedron? (is it: print $p->VERTICES;)
3- As my problem is an optimization program (BIP) what is the best way to use the "$f = lp2poly" method inside of the "https://shell.polymake.org/"? if not, is there any alternative? (to clear: is there any way to define a MILP by the above matrix form?)
Best regards
Abbas