我正在寻找一个好用的R包来解决线性规划模型。我对默认的
示例模型:
lpSolve::lp
非常满意,但是无法获取影子价格和降低的价格。我需要这些东西,以及完整性约束。示例模型:
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???