Dear R-users,
i try to solve to following linear programm in R
0 * x_1 + 2/3 * x_2 + 1/3 * x_3 + 1/3 * x_4 = 0.3
x_1 + x_2 + x_3 + x_4 = 1
x_1, x_2, x_3, x_4 > 0,
x_1, x_2, x_3, x_4 < 1
as you can see i have no objective function here besides that i use the
following code.
library(lpSolve)
f.obj<-c(1,1,1,1)
f.con<-matrix(c(0,2/3,1/3,1/3,
1,1,1,1,
1,0,0,0,
0,1,0,0,
0,0,1,0,
0,0,0,1),nrow=6,byrow=TRUE)
f.dir <- c("=", "=", ">", ">", ">", ">")
f.rhs <- c(0.3, 1, 0, 0, 0, 0)
lp ("max", f.obj, f.con, f.dir, f.rhs)$solution
the problem is, the condition x_1, x_2, x_3, x_4 > 0 is not fulfilled.
Any advice would be very helpful.
best regards
Andreas
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.