Closed fillipefeitosa closed 3 years ago
From your description, it sounds like it's the optimization that takes long (which probably makes sense if you have a large number of variables and you're solving a hard problem).
To figure out if the .sum()
method takes longer, you can track the execution of the code up to and pass the relevant part in the code. But it really sounds like you're even starting the optimization.
Thank you for your interest in Gurobi Optimizer!
If you're an academic and your problem goes beyond installation, licensing, and bug reports please visit our Gurobi Support Portal (https://support.gurobi.com/) where you may be able to get answers to your questions via:
If you are a commercial user or an academic having installation and/or licensing issues or would like to report a bug, please submit a request through our Gurobi Support Portal. To do this, simply follow these instructions:
Kind regards,
Hello there! Using this as base example
I am probably doing something wrong here. I have a distance matrix with costs for traveling from point to point. Not using facility fixed cost, so I want to limit the number of facilities just to fulfill the total demand, such as:
Assuming that 32 is the max number of facilities I want open, the model takes too long. The way I understood, open.sum() is supposed to give me the sum of the Binary variables on that solution, ie. the number of open facilities. Is it not supposed to have this quicksum quite fast?
This is a less hardcoded version I made to test. It works (opens 31 facilities), only because all facilities have 80 units to offer. But it takes so long that I need to Control+C to get objetive value and opened facilities.
open has 628 items
Thanks for your time!