I am looking for a R package to solve linear programming models. The default lpSolve::lp works fine, but I can't get the shadow and reduced prices. For example:
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?