Patrizia
unread,Mar 8, 2009, 1:41:03 PM3/8/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Xpress-MP
Hi there!
I'm trying to solve the following problem: I've got five production
plants and numerous customers and I have to decide what amount of a
product should be produced by which plant to serve the needs of the
customers.
As I'm new to the XPress MP (Student version) I implemented that in
the
only way I could think of:
model test
uses "mmxprs"; !gain access kg the Xpress-Optimizer solver
!sample declarations section
declarations
a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, !variables for the amout
of products
b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, ! 1...10 --> customers
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, ! a...e --> plants
d1, d2, d3, d4, d5, d6, d7, d8, d9, d10,
e1, e2, e3, e4, e5, e6, e7, e8, e9, e10: mpvar
ka1=; ka2=; ka3=; ka4=; ka5=; ka6=; ka7=; ka8=; ka9=; ka10=; !costs
of production for each customer & plant
kb1=; kb2=; kb3=; kb4=; kb5=; kb6=; kb7=; kb8=; kb9=; kb10=;
kc1=; kc2=; kc3=; kc4=; kc5=; kc6=; kc7=; kc8=; kc9=; kc10=;
kd1=; kd2=; kd3=; kd4=; kd5=; kd6=; kd7=; kd8=; kd9=; kd10=;
ke1=; ke2=; ke3=; ke4=; ke5=; ke6=; ke7=; ke8=; ke9=; ke10=;
end-declarations
!the objective function consists of costs*amountvariables added up
Ziel:=ka1*a1+ka2*a2+ka3*a3+ka4*a4+ka5*a5+ka6*a6+ka7*a7+ka8*a8+ka9*a9+ka10*a10+
kb1*b1+kb2*b2+kb3*b3+kb4*b4+kb5*b5+kb6*b6+kb7*b7+kb8*b8+kb9*b9+kb10*b10+
kc1*c1+kc2*c2+kc3*c3+kc4*c4+kc5*c5+kc6*c6+kc7*c7+kc8*c8+kc9*c9+kc10*c10+
kd1*d1+kd2*d2+kd3*d3+kd4*d4+kd5*d5+kd6*d6+kd7*d7+kd8*d8+kd9*d9+kd10*d10+
ke1*e1+ke2*e2+ke3*e3+ke4*e4+ke5*e5+ke6*e6+ke7*e7+ke8*e8+ke9*e9+ke10*e10
a1+b1+c1+d1+e1= !constraint --> customers needs must be met
a2+b2+c2+d2+e2=
a3+b3+c3+d3+e3=
a4+b4+c4+d4+e4=
a5+b5+c5+d5+e5=
a6+b6+c6+d6+e6=
a7+b7+c7+d7+e7=
a8+b8+c8+d8+e8=
a9+b9+c9+d9+e9=
a10+b10+c10+d10+e10=
a1+a2+a3+a4+a5+a6+a7+a8+a9+a10= !production capacity constraints
for the plants
b1+b2+b3+b4+b5+b6+b7+b8+b9+b10=
c1+c2+c3+c4+c5+c6+c7+c8+c9+c10=
d1+d2+d3+d4+d5+d6+d7+d8+d9+d10=
e1+e2+e3+e4+e5+e6+e7+e8+e9+e10=
minimize(Ziel)
Unfortunately the result was quite frustrating, and even when I gave
the cheaper production plants significantly larger capacities it
didn't get a lot better.
I'm wondering now if that is because of my dilettantism or because of
the size of the problem ( 80 customers and five plants plus the
respective constraints)
I'd be grateful for your help!
thanks,
Patrizia