help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] lpx_simplex don't maximise anything !


From: Nicoco BERGER
Subject: [Help-glpk] lpx_simplex don't maximise anything !
Date: Sun, 9 Oct 2005 17:04:00 +0200 (CEST)

Hi

I have to solve a knapsack problem : I have n variables with both a weight and 
a value
for each, and I want to maximize the value I get summing the value of variables 
put to 1
(as the corresponding object is taken in the sack), while the sum of the 
weigths of the
variables put to 1 cannot be greater than the initial capacity of the sack... 
After having set up the model in the solver, the objective function (which is 
set to
"maximize") always returns 0. The solver has the correct model in memory 
though, I mean
there is no mistake in the inequations that are known by the solver, no, the 
problem is
that  the solver doesn't maximize anything. Can you help me ?

example :

3 binary variables x1, x2, x3

values :
z1 = 4
z2 = 7
z3 = 3
 
weights :
w1 = 4
w2 = 4
w3 = 4

initial capacity :
7

=>solution : x1 = 0, x2 = 1, x3 = 0 : the maximum value I can take in the sack 
is z2 = 7
 
Problem : in this very small example the solver tells me the maximum is 0... 
There must
be something I am doing wrong, but what ?





        

        
                
___________________________________________________________________________ 
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
Téléchargez cette version sur http://fr.messenger.yahoo.com




reply via email to

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