I am trying to solve a Capacitated Facility Location Problem (CFLP) with a dynamic setup cost in R.

The problem statement is this:

  1. I have the transport cost
  2. The fixed operating cost (manual labor and other expenses) is known
  3. I know the dropping points with loads and all the details
  4. The per square ft. cost of rent of a place is known
  5. 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.

  • $\begingroup$ What is the formula for rent as a function of load? $\endgroup$
    – prubin
    Commented Nov 17, 2021 at 16:02
  • $\begingroup$ Sorry. Should have added that. Now added: total_rent= rent_per_square_ft * load* 0.10 $\endgroup$ Commented Nov 17, 2021 at 16:18
  • $\begingroup$ Rent per square foot is a constant (meaning no economies or diseconomies of scale)? $\endgroup$
    – prubin
    Commented Nov 17, 2021 at 23:02
  • $\begingroup$ Yes, it is a constant. @prubin $\endgroup$ Commented Nov 18, 2021 at 3:15
  • 1
    $\begingroup$ @SecretAgentMan I updated the question first and then made the comment. $\endgroup$ Commented Nov 22, 2021 at 4:46

1 Answer 1


Based on the comments, the rent for facility $j\in \lbrace 1,\dots,m \rbrace$ would be $0.1\cdot R \cdot \sum_{i=1}^n d_i x_{ij}$ where $d_i$ is the demand for customer $i$ and $R$ is the rent per square foot. If the rent per square foot varies from facility to facility, just change $R$ to $R_j$. Sum those expressions over $j$ and add the sum to the objective function.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.