'lpSolve and sensitivity analysis
I am trying to solve a basic LP problem as follows:
require(lpSolve)
ofc <- c(90,60)
conl <- matrix(c(1,1,0,1,6,3),nrow=3,byrow=TRUE)
conr<-c(100,65,480)
cond <- c("<=", "<=", "<=")
optimum <- lp(direction="max",
objective.in = ofc,
const.mat = conl,
const.dir = cond,
const.rhs = conr,
all.int = F, compute.sens=TRUE)
print(optimum$duals.from)
print(optimum$duals.to)
Output:
[1] 8.00e+01 -1.00e+30 4.05e+02 -1.00e+30 -1.00e+30
[1] 1.125e+02 1.000e+30 6.000e+02 1.000e+30 1.000e+30
Comparing output with Excel Solver and Lindo I get exactly the same results except in one respect: the lower RHS limit for constraint 2, which bounds the second variable above by 65. In Excel and Lindo I get the value 25 as an allowable decrease, which corresponds to a lower limit of 40. I'd expect this to be the second value in the penultimate line of output. Instead I get -infinity. The other limits are fine. Any clue what I'm doing wrong?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
