Rajhans Samdani
unread,Nov 13, 2011, 7:10:32 PM11/13/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to CVXOPT
Hi!
I am using cvxopt 1.1 and glpk version 4.4.2. I tried running a very
simple and vacuous (effectively unconstrained) ILP as a sanity-check
but I am getting the wrong answer. I am solving
max c'x
s.t.
Gx <=h
where x is 3 dimensional binary vector, G=1,1,1 and h = 5 (so the
problem is effectively unconstrained as x1+x2+x3 is always less than
5.) The answer irrespective of the value of c is always 0,0,0!!
Following shows the python command line operations. Am I doing
something obviously wrong? Please help!
>>> G=matrix([1.0,1.0,1.0],(1,3))
>>> h=matrix([5.0])
>>> c=matrix([-10,-10,-15],(3,1))
>>> b=set([0,1,2])
>>> (s,y)=glpk.ilp(G=G,c=c,h=h,B=b)
GLPK Integer Optimizer, v4.42
1 row, 3 columns, 3 non-zeros
3 integer variables, all of which are binary
Preprocessing...
Objective value = nan
INTEGER OPTIMAL SOLUTION FOUND BY MIP PREPROCESSOR
>>> print y
[ 0.00e+00]
[ 0.00e+00]
[ 0.00e+00]
>>> c=matrix([10,10,15],(3,1))
>>> (s,y)=glpk.ilp(G=G,c=c,h=h,B=b)
GLPK Integer Optimizer, v4.42
1 row, 3 columns, 3 non-zeros
3 integer variables, all of which are binary
Preprocessing...
Objective value = 0.000000000e+00
INTEGER OPTIMAL SOLUTION FOUND BY MIP PREPROCESSOR
>>> print y
[ 0.00e+00]
[ 0.00e+00]
[ 0.00e+00]
Thanks!
Rajhans