Skip to content

Modeling error for sure #339

Answered by dirkschumacher
lucazav asked this question in Q&A
May 28, 2021 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

The problem is that your linear program is unbounded without the lower bound on the variables. If the linear program is unbounded, then the solution code is infeasible and thus you cannot get a result. I hope this helps. Below is the output of GLPK signalling that the LP is unbounded.

library(ompr)
library(ompr.roi)
library(ROI.plugin.glpk)
n_countries <- 6
n_warehouses <- 4

country_demands <- c(40000, 15000, 25000, 45000, 25000, 25000)

warehouse_supply <- c(50000, 30000, 40000, 55000)

cost_matrix <- structure(c(
  8, 12, 34, 25, 18, 10, 32, 20, 14, 8, 30, 18, 40,
  18, 10, 35, 40, 40, 33, 30, 25, 18, 35, 10
), .Dim = c(4L, 6L), .Dimnames = list(
  c("Warehouse ITA", "Warehouse DEU", "W…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@dirkschumacher
Comment options

@lucazav
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by dirkschumacher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants