[R] Linear programming problem, RGPLK - "no feasible solution"

Liu Evans, Gareth Gareth.Liu-Evans at liverpool.ac.uk
Fri Oct 7 15:25:19 CEST 2011


Dear All,

RGLPK says that there is no feasible solution but I think there should be.  In a more general setup with more variables, where we know the feasible solution analytically, it also says there is no feasible solution.  I have tried different values. except the 0s and 1s must stay as they are.  The result has always been the same so far, i.e. no feasible solution.


Here is my code:


obj <- c(rep(0,3),1)

col1 <-c(1,0,0,1,0,0,1,-2.330078923,0)
col2 <-c(0,1,0,0,1,0,1,-2.057855981,0)
col3 <-c(0,0,1,0,0,1,1,-1.885177032,0)
col4 <-c(-1,-1,-1,1,1,1,0,0,1)

mat <- cbind(col1, col2, col3, col4)

dir <- c(rep("<=", 3), rep(">=", 3), rep("==", 2), ">=")

rhs <- c(rep(0, 6), ej, 0)

sol <- Rglpk_solve_LP(obj, mat, dir, rhs, types = NULL, max = FALSE,
bounds = c(-100,100), verbose = TRUE)

Regards,
Gareth



More information about the R-help mailing list