Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Gaming > Development Programming Algorithms > Re: better McDo...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 619 of 675
Post > Topic >>

Re: better McDoonalds meals than MinMax?

by Miss Elaine Eos <Misc@[EMAIL PROTECTED] > Feb 26, 2007 at 07:53 AM

In article <54g41eF20necfU1@[EMAIL PROTECTED]
>,
 "Gernot Frisch" <Me@[EMAIL PROTECTED]
> wrote:

> Hi,
> 
> assume you have a list of products + price like:
> bigmc 3.59
> koke  1.29
> friez 0.79
> ...
> 
> and some meals like:
> bigmc + koke + friez = 3.95
> 
> 
> I want to make a program that lets you select the pruducts and then 
> get the cheapest combination, even if it has some extra stuff for you.
> 
> I'd start by making a list of the products individually, then try to 
> swap them with a menu and use a MinMax algorithm to go deeper into 
> mixing.
> 
> Is there any better idea to reach this?

Depending on the product count, if it's < 32 (or, say, up to about 128 
or so), you can assign each product a bit, then the combos will have 
several bits.  So, maybe:

   bigmc 0x01
   koke  0x02
   pepsi 0x04
   friz  0x08
   [...]

   combo1   bigmc | koke | friz
   combo2   bigmc | pepsi| fiz
   [...]

etc.  Then you can say

   desired = X | Y | Z

and and-together the desired against the various combos to eliminate the 
ones that don't have the correct items.  (If desired & combo != desired, 
then you're missing something.)

pick the lowest-prices combo from those remaining.

-- 
Please take off your pants or I won't read your e-mail.
I will not, no matter how "good" the deal, patronise any business which
sends
unsolicited commercial e-mail or that advertises in discussion newsgroups.
 




 3 Posts in Topic:
better McDoonalds meals than MinMax?
"Gernot Frisch"  2007-02-26 14:01:33 
Re: better McDoonalds meals than MinMax?
Miss Elaine Eos <Misc@  2007-02-26 07:53:51 
Re: better McDoonalds meals than MinMax?
"Gernot Frisch"  2007-02-27 08:58:54 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 9 4:47:08 CDT 2008.