I have quite a simple linear programming problem. Where I want to maximise z with various constraints. However, I'm not sure how to write constraint number 4. I need both x and y to be above 2. Any solutions?
max z = 5x + 4y
constraints:
1) 4x + 2y <18 , 2) x+y<9 , 3)2x+3y<19 , 4) x,y>2
library(lpSolve)
f.obj <- c(5,4)
f.con <- matrix(c(4,2,
1,1,
2,3),nrow=3,byrow=TRUE)
f.dir <- c("<=",
"<=",
"<=")
f.rhs <- c(18,
9,
19)
lp("max",f.obj,f.con,f.dir,f.rhs)$solution