I am trying to solve a Capacitated Facility Location Problem (CFLP) with a dynamic setup cost in R
.
The problem statement is this:
- I have the transport cost
- The fixed operating cost (manual labor and other expenses) is known
- I know the dropping points with loads and all the details
- The per square ft. cost of rent of a place is known
- The size of the Facility will be a function of the load. So the rent will depend on how much load is getting allocated in that place.
Assuming the rent will vary like this:
rent= rent_per_square_ft * load* 0.10
Now, I have accommodated the first 4 conditions in my code. But I am not sure how the number 5 can be accommodated.
My model looks like this in R
(if it can be of any help):
#m is the number of potential facility/service center (SC) locations
#n is the number of customer locations
model <- MIPModel() %>%
# 1 if customer i gets assigned to SC j
add_variable(x[i, j], i = 1:n, j = 1:m, type = "binary") %>%
# 1 if SC j is built
add_variable(y[j], j = 1:m, type = "binary") %>%
# Objective function
set_objective(sum_expr(transportcost(i, j) * x[i, j], i = 1:n, j = 1:m) +
sum_expr(fixedcost[j] * y[j], j = 1:m), "min") %>%
# Every customer needs to be assigned to a SC
add_constraint(sum_expr(x[i, j], j = 1:m) == 1, i = 1:n) %>%
# If a customer is assigned to a SC, then the SC must be built
add_constraint(x[i,j] <= y[j], i = 1:n, j = 1:m) %>%
#The demand of customers shouldn't exceed SC capacities
add_constraint(sum_expr(demand[i] * x[i, j], i = 1:n) <= capacity[j] * y[j], j = 1:m)
I am looking for any headway. Even any link to a relevant article might help.