Forum Discussion
FICO
3 years agoCommunity Manager
Memory usage when repeatedly solving a problem
I want to solve for a facility problem the corresponding transport problems by enumerating all possible combinations of the binaries (12 DCs, so 2^12 combinations) - I need the optimal flows and cost...
FICO
3 years agoCommunity Manager
Your subroutine contains some unary constraints ('is_binary' and bounds on variables) that are not reset. The easiest solution would probably be to rewrite your subroutine as follows:
procedure ND
declarations
z: array(PLANT, DC, PRODUCT) of mpvar
x: array(DC, CUSTOMER, PRODUCT) of mpvar
y: array(DC) of mpvar
penalty_dist: array(CUSTOMER) of mpvar
CO2: mpvar
end-declarations
with mpproblem do
forall(i in DC) y(i) is_binary
obj:=sum(i in DC, j in CUSTOMER, k in PRODUCT) x(i,j,k)*INT_DISTANCE(i,j)*INT_TRANS_OUT_COST + sum(i in DC) y(i)*INT_WHS_FIX_COST + sum(i in PLANT, j in DC, k in PRODUCT) z(i,j,k)*INT_DISTANCE(i,j)*INT_TRANS_INB_COST + sum(j in CUSTOMER)penalty_dist(j)*9999999 + CO2/1000*INT_CERTIFICATE_COST
C0:=CO2=sum(i in DC, j in CUSTOMER, k in PRODUCT) x(i,j,k)*INT_DISTANCE(i,j)*INT_EM_OUT + sum(i in PLANT, j in DC, k in PRODUCT) z(i,j,k)*INT_DISTANCE(i,j)*INT_EM_INB
forall(i in DC, k in PRODUCT)
C1(i,k):=sum(m in PLANT)z(m,i,k) = sum(j in CUSTOMER)x(i,j,k)
forall(i in DC, k in PRODUCT)
C2(i,k):=sum(j in CUSTOMER)x(i,j,k) <= y(i)*INT_BIGM(k)
forall(j in CUSTOMER, k in PRODUCT)
C3(j,k):=sum(i in DC)x(i,j,k) >= EXT_DEMAND_QUANTITY(j,k)*INT_DEMAND_MULTIPLIER
forall(i in DC) do
if EXT_DC_STATUS(i)=1 then
y(i)=1
end-if
if EXT_DC_STATUS(i)=0 then
y(i)=0
end-if
end-do
forall(i in DC, j in CUSTOMER, k in PRODUCT)
C4(i,j,k):=x(i,j,k)*INT_DISTANCE(i,j) <= x(i,j,k)*INT_MAX_DISTANCE_CUST(j) + penalty_dist(j)
minimize(obj)
![...] write output to console
end-do ! Leave the subproblem (resets solution info and deletes all constraints)
end-procedureWhile working on your model, in order to track the memory consumption, you could add a call to ''memoryuse" after terminating an iteration of the subroutine (remove such calls for production runs as they add to the execution time).
Related Content
Related Content
A specific separation procedure, $(l,S)$ Inequalities, to solve the lot-sizing problem
Dear support team, I have tried to use a specific separation procedure, $(l, S)$ Inequalities, to solve the lot-sizing problem proposed in the references, like Algorithm and formulations for lot siz...8 months agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum4 unread comments4 unread9Views0likes4CommentsGPU implementation: Trying to solve a MILP problem with PDHG and GPU in an AWS machine.
I get this log: "GPU support is not available for the hybrid gradient algorithm in the deterministic concurrent LP solver. The CPU version will be used instead." Am I doing something wrong or the PD...9 months agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum6 unread comments6 unread0Views0likes6CommentsHow can I use ODH for solving a MIP model using Xpress Python API?
Hi everyone, I want to play a bit with ODH for Xpress Solver. I did run ODH from the command line but now I want to integrate it in the whole pipeline of a Python program. What should I import? What...1 month agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum2 unread comments2 unread7Views0likes2Comments