Unbounded or badly scaled problem

933 views
Skip to first unread message

msaqib

unread,
Jul 9, 2009, 4:18:12 PM7/9/09
to am...@googlegroups.com

Hello everyone
My optimization problem is the following scenario:
1- Raw material (cotton) is needed at different locations to meet a minimum
production workload
2- Production units are available at different locations.
3- Raw material costs vary every day, and are possibly different at each
location.
4- Production machines consume cotton at two different rates (idle and
peak).
5- Production time unit (say, shifts or days) may or may not be the same as
the procurement time units. For instance, you can buy cotton once every day.
You can do futures purchases based on projected future cost.
6- Our inventory may already have some cotton procured for a certain
production intervals.
7- If I have excesss cotton at some unit, I can dispose of it in the market
I've implemented the model in AMPL and tried to solve it using minos solver,
and I get the following error: "Unbounded or badly scaled problem." If I get
rid of the selling option (point 7 above, by removing the Sell_Cotton term
in the objective function, the solver finds and optimal solution.
Could you kindly take a look at the attached model and data file and suggest
why this is a badly scaled problem?
Thanks and best regards

http://www.nabble.com/file/p24413197/MyProblem.txt MyProblem.txt
http://www.nabble.com/file/p24413197/MyProblem-Data.txt MyProblem-Data.txt
--
View this message in context: http://www.nabble.com/Unbounded-or-badly-scaled-problem-tp24413197p24413197.html
Sent from the AMPL mailing list archive at Nabble.com.

msaqib

unread,
Jul 9, 2009, 4:18:52 PM7/9/09
to am...@googlegroups.com

The last message missed the model file

http://www.nabble.com/file/p24413207/MyProblem.txt MyProblem.txt
--
View this message in context: http://www.nabble.com/Unbounded-or-badly-scaled-problem-tp24413197p24413207.html

Robert Fourer

unread,
Jul 16, 2009, 11:05:53 PM7/16/09
to am...@googlegroups.com, msaqib

This does not appear to be a badly scaled problem, but rather an unbounded
problem. To see that, I added a constraint that places a lower bound of
-100000000 on the objective function:

subj to obj_lower_bound:
sum{i in LOCATIONS, j in PROC_TIMES, k in PROC_TIMES}
exp((j - k)*interest_rate/tyr)*(cotton_price[i,k]*
(Buy_Cotton[i,j,k] - Sell_Cotton[i,j,k])) >= -1000000000;

Then MINOS returned the solution copied below, in which the objective value
is exactly equal to -100000000. To prevent this behavior you would need to
add some constraints or bounds, or otherwise fix your model, so that such
solutions would no longer be possible.

Bob Fourer
4...@ampl.com


ampl: display {j in 1.._nvars: _var[j] > 0} (_varname[j],_var[j]);

: _varname[j] _var[j] :=
1 "Machines['Lahore',1]" 100
2 "Machines['Lahore',2]" 1000
3 "Machines['Lahore',3]" 1000
4 "Machines['Lahore',4]" 1000
5 "Machines['Lahore',5]" 1000
6 "Machines['Lahore',6]" 1000
7 "Machines['Lahore',7]" 1000
15 "Buy_Cotton['Lahore',1,1]" 574860
16 "Buy_Cotton['Lahore',1,2]" 5748500
19 "Buy_Cotton['Lahore',1,5]" 5748600
24 "Buy_Cotton['Lahore',2,3]" 5748600
32 "Buy_Cotton['Lahore',3,4]" 5748600
47 "Buy_Cotton['Lahore',5,5]" 9.31323e-10
48 "Buy_Cotton['Lahore',5,6]" 0.000243824
55 "Buy_Cotton['Lahore',6,6]" 5748600
56 "Buy_Cotton['Lahore',6,7]" 5748600
69 "Buy_Cotton['Karachi',1,6]" 7.27119e+11
113 "Ut['Lahore',1]" 0.001
114 "Ut['Lahore',2]" 0.001
115 "Ut['Lahore',3]" 0.001
116 "Ut['Lahore',4]" 0.001
117 "Ut['Lahore',5]" 0.001
118 "Ut['Lahore',6]" 0.001
119 "Ut['Lahore',7]" 0.001
127 "temp_Required_Cotton['Lahore',1]" 574860
128 "temp_Required_Cotton['Lahore',2]" 5748600
129 "temp_Required_Cotton['Lahore',3]" 5748600
130 "temp_Required_Cotton['Lahore',4]" 5748600
131 "temp_Required_Cotton['Lahore',5]" 5748600
132 "temp_Required_Cotton['Lahore',6]" 5748600
133 "temp_Required_Cotton['Lahore',7]" 5748600
141 "Required_Cotton['Lahore',1]" 574860
142 "Required_Cotton['Lahore',2]" 5748600
143 "Required_Cotton['Lahore',3]" 5748600
144 "Required_Cotton['Lahore',4]" 5748600
145 "Required_Cotton['Lahore',5]" 5748600
146 "Required_Cotton['Lahore',6]" 5748600
147 "Required_Cotton['Lahore',7]" 5748600
163 "Sell_Cotton['Lahore',2,2]" 5748600
166 "Sell_Cotton['Lahore',2,5]" 5748600
171 "Sell_Cotton['Lahore',3,3]" 5748600
179 "Sell_Cotton['Lahore',4,4]" 5748600
195 "Sell_Cotton['Lahore',6,6]" 0.000243824
203 "Sell_Cotton['Lahore',7,7]" 5748600
244 "Sell_Cotton['Karachi',6,6]" 7.27119e+11

> -----Original Message-----
> From: am...@googlegroups.com [mailto:am...@googlegroups.com]
> On Behalf Of msaqib [msa...@gmail.com]
> Sent: Thursday, July 09, 2009 11:19 AM
> To: am...@googlegroups.com
> Subject: [AMPL 2633] Re: Unbounded or badly scaled problem
>
>
>
> The last message missed the model file
>
>
>

msaqib

unread,
Jul 17, 2009, 6:46:51 AM7/17/09
to am...@googlegroups.com

Thanks Robert. That was very helpful. I also only just decided to change the
last constraint, so that I allow selling of pre-existing cotton, only.
Because otherwise, the solver may try to look for solutions where it buys
cotton during low cost periods and later sells it. Unnecessary buying for
anticipated profit is against the spirit of the problem. Selling cotton
should only be done if it is surplus and even after selling at a loss you
can buy as much or more cotton at a different location, at a lower price.
Thanks again.
--
View this message in context: http://www.nabble.com/Unbounded-or-badly-scaled-problem-tp24413197p24529403.html
Reply all
Reply to author
Forward
0 new messages