[R] Binary decision problem
Moshe Olshansky
m_olshansky at yahoo.com
Fri Jun 22 01:28:10 CEST 2007
Hi Tolga,
I do not see any problem with:
max {a1*x1 + a2*x2 + ... + a800*x800}
subject to:
x1+x2+ ... + x800 = 100
b1*x1+b2*x2+ ... +b800*x800 <= B
c1*x1+c2*x2+ ... +c800*x800 <= C
and an additional condition that x1,x2,...,x800 are
binary 0-1.
Regards,
Moshe Olshansky
--- Tolga Uzuner <tolga.uzuner at gmail.com> wrote:
> Dear R Users,
>
> I am trying to use LP_SOLVE and would appreciate any
> assistance with
> the following problem:
> - I am trying to choose a fixed number of items out
> of a batch of
> items: say 100 out of 800
> - items have certain characteristics, say
> characteric A, B and C
> - I want to maximise the sum of A across all 100
> items I choose while
> ensuring that the sum of B and C across the items do
> not exceed
> certain constraints
>
> How exactly do I set this up in lp_solve ? If I
> associate a boolean, 0
> or 1, with each item, I can constrain the sum of the
> boolean to be
> equal to 100. But how do I then further specify the
> other constraints
> (on the sum of B and the sum of C) and the objective
> function (to
> maximise the sum of A) ?
>
> Thanks,
> Tolga
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>
More information about the R-help
mailing list