[R] Optimizing problem R

kylmala kylmala at wippies.fi
Thu May 24 07:56:43 CEST 2012


Hi,

and thanks for replying this. Yes, you are right that the term
min(24/bb,26/cc) is actually min(bb/24,cc/26) - my mistake. But still I
don't get it. If the objective function is 

#min(m1,m2,m3)
f.obj <- c(1, 1, 1)

#and we now that 
# a+aa<=15 
# b+bb+bbb<=35 
# cc+ccc<=40 

# so

# 1a + 0b + 0c + 1aa + 0bb + 0cc + 0aaa + 0bbb + 0ccc <=15
# 0a + 1b + 0c + 0aa + 1bb + 0cc + 0aaa + 1bbb + 0ccc <=35
# 0a + 0b + 0c + 0aa + 0bb + 1cc + 0aaa + 0bbb + 1ccc <=40
# and the matrix of numeric constraint coefficients is 

C = matrix(nrow=3, data=c(1,0,0,0,1,0,0,0,0,1,1,0,0,0,1,0,1,0,0,0,1))

#Constraits are: 

f.rhs <- c(15, 35, 40)

#and 

f_dir = c("<=", "<=", "<=")

Because the command lp is form lp ("max", f.obj, f.con, f.dir, f.rhs), how
can I get those other constraints in

 m1 <= a/10 
  m1 <= b/11 
  m2 <= aa/13 
  m2 <= bb/12 
  m2 <= cc/10 
  m3 <= bb/24 
  m3 <= cc/26



--
View this message in context: http://r.789695.n4.nabble.com/Optimizing-problem-R-tp4631048p4631168.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list