MIP - CPLEX solver does not give optimal solution in a facility location problem

Problems with modeling
Post Reply
ldessbes
User
User
Posts: 3
Joined: 3 months ago

MIP - CPLEX solver does not give optimal solution in a facility location problem

Post by ldessbes » 3 months ago

I'm somewhat new to GAMS, and totally new to this forum,
I was hoping that someone could help me to understand why my model "All13" gives a solution that differs from my model "max7" (attached). I hoped that the model All13 (obj= 26,608,552) would give the minimum cost over all combinations. However, when running some scenarios, I observed that does not happen. As exemplified in by model max7 (obj= 25,415,487), where I find a lower cost than in All13.
The model aims to minimize total cost considering transportation cost and capital investment. It decides the supply configuration, plant locations and the capacity of each plant. Could someone please help me to improve "all13"? or help me to understand why it does not minimize the total cost?

Thank you so much,
Luana
Attachments
max7.gms
(6.88 KiB) Downloaded 12 times
All13.gms
(6.79 KiB) Downloaded 12 times

User avatar
bussieck
Moderator
Moderator
Posts: 115
Joined: 1 year ago

Re: MIP - CPLEX solver does not give optimal solution in a facility location problem

Post by bussieck » 3 months ago

Before digging deeper, have you set optCR to 0 as described here https://www.gams.com/latest/docs/UG_Lan ... ntProblems?

-Michael

ldessbes
User
User
Posts: 3
Joined: 3 months ago

Re: MIP - CPLEX solver does not give optimal solution in a facility location problem

Post by ldessbes » 3 months ago

Hi Michael,
Thank you for your suggestion. Yes, I have tried it before, and the result is the same as without "scaleopt = 0".
It seems that my model is first minimizing the transportation cost, and when that is set, it calculates the capital investment. Which is not what it should do, and I can't figure out why it is not minimizing both.

Thank you again, and if you have more suggestions please share. Highly appreciated.
Luana

User avatar
bussieck
Moderator
Moderator
Posts: 115
Joined: 1 year ago

Re: MIP - CPLEX solver does not give optimal solution in a facility location problem

Post by bussieck » 3 months ago

I said optCR (not scaleOpt)! If I set optCR to 0 both models return the same objective:

max7:

Code: Select all

Proven optimal solution.

MIP Solution:     25415486.875000    (55 iterations, 0 nodes)
Final Solve:      25415486.875000    (20 iterations)

Best possible:    25415486.875000
Absolute gap:            0.000000
Relative gap:            0.000000
all13:

Code: Select all

Proven optimal solution.

MIP Solution:     25415486.875000    (55 iterations, 0 nodes)
Final Solve:      25415486.875000    (20 iterations)

Best possible:    25415486.875000
Absolute gap:            0.000000
Relative gap:            0.000000
Just add "option optcr=0;" in front of the solve statement!

-Michael

ldessbes
User
User
Posts: 3
Joined: 3 months ago

Re: MIP - CPLEX solver does not give optimal solution in a facility location problem

Post by ldessbes » 3 months ago

Michael,
First, I'm sorry for not reading your message with the proper attention; second, thank you for being so nice and patient,
It was the default tolerance that was returning a suboptimal value.
Thank you so much, you saved my day!

Post Reply