r - Linear programming: not all constraints should be satisfied -
using r, easy linear programming lpsolve
, lpsolveapi
packages. now, want linear programming part of constraints satisfied. say, 80% of constraints satisfied. can not predefine constraints should satisfied. how implement using r?
an example here. there 100 different tissue samples, each sample, 10000 ~ 20000 genes expressed. now, want select @ 10 samples purpose cover many genes possible. 1 solution based on lpsolve
set 100 samples variables , 20000 genes constraints. first, manually filter genes, , lp
, until solution hit 10 samples. however, laborious , not optimal.
set.seed(123) t.mt <- matrix(sample(c(0,1),100000,rep=true),nr=1000) f.obj <- rep(1,100) f.dir <- rep(">=",1000) f.rhs <- rep(1,1000) t.lp <- lp("min",f.obj,t.mt,f.dir,f.rhs,all.int=true,all.bin=true) t.lp$solution
is there possible solution using r problem?
thank you!
Comments
Post a Comment