I am searching for a nice R package to solve linear programming models. I'm quite happy with the default lpSolve::lp
, but there's no way to get the shadow and reduced prices. I need these, together with integrality constraints.
Sample model:
A = rbind(
c(0.5, 0.2, 0.2),
c( -1, 1, 0),
c( 0, 1, -1),
c( -1, -1, -1),
c( -1, 0, 0),
c( 0, -1, 0),
c( 0, 0, -1)
)
b = c(5, 0, 0, -13, 0, 0, 0)
c_ = c(8.4, 6, 9.2)
(signs = c('=', rep('<=', 6)))
res = lpSolve::lp('min', c_, A, signs, b, all.int = TRUE)
# Objective function
res
# Variables
res$solution
# Shadow prices???
# Reduced prices???
dual values
for constraints. Is this what you're looking for? – Ergosterol