# Re: [R] Binary decision problem

From: Moshe Olshansky <m_olshansky_at_yahoo.com>
Date: Thu, 21 Jun 2007 16:28:10 -0700 (PDT)

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
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained,
> reproducible code.
>

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. Received on Thu 21 Jun 2007 - 23:31:37 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 22 Jun 2007 - 00:32:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.