help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange behavior with glpk in Octave3.6.4_gcc4.6.2 over Windows when


From: semola74
Subject: Re: Strange behavior with glpk in Octave3.6.4_gcc4.6.2 over Windows when using the constraint type "D":
Date: Wed, 12 Jun 2013 04:51:29 -0700 (PDT)

Hi Emanuele,
I am a newbie of Octave, but I am facing a problem like yours with glpk when
using the constraint type "D". First of all, let me suggest you to set the
message verbosity to full output before you start the calculation:

param.msglev = 3;

Then use the full output structure like this:

[xopt,fopt,status,extra] = glpk([1],[1],[1],[0],[1],"D","C",-1,param)
Now, about your problems, I expected the same answers. It seems that glpk
solver does not know where to start from: error 204 (LPX_E_FAULT) "Unable to
start the search". The same output is also given by Octave 3.4.3 configured
"x86_64-redhat-linux-gnu", which I am using at the moment.
One may think that 1-dimensional problems are too "particular" or
"degenerate", but I have given glpk a test problem in 2 variables, so easy
that one can solve it with a pencil, and the behaviour seems very alike:
 objective function: z = -5x-6y
 constraints:
      |x+2y| <= 2    that is   -2 <= x+2y <= +2 , and
      |3x-4y| <= 1  that is    -1 <= 3x-4y <= +1 .
The problem can be resolved on the Cartesian plane by hand, and it should be
found that the feasible region is a parallelogram, which is symmetrical to
the origin and has vertices in (1; 1/2), (3/5; 7/10), (-3/5; -7/10) and (-1;
-1/2); on vertices, the objective function has values -8, -36/5=-7.2 ,
+36/5=+7.2 and +8 respectively. If the sense of the problem is minimization,
then (1; 1/2) is the optimal value.
The code that should represent this problem is:

clear -all;
A = [1, 2; 3, -4]
b = [2; 1]
c = [-5; -6]
lb = [0; 0]
ub = []
ctype = "DD"
vartype = "CC"
sense = 1;
param.msglevel = 3;
param.lpsolver = 1;
[z,fopt,status,extra] = glpk(c,A,b,lb,ub,ctype,vartype,sense,param)
The error message is again 204. Please check if I missed anything, or
misunderstood the manual. I would really appreciate this constraint type, if
available for coding.




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Strange-behavior-with-glpk-in-Octave3-6-4-gcc4-6-2-over-Windows-when-using-the-constraint-type-D-tp4653963p4654107.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]