[thelist] SQL to get combo that sums to amount

Joshua Olson joshua at waetech.com
Thu Sep 9 09:00:01 CDT 2004

> -----Original Message-----
> From: Joshua Olson
> Sent: Thursday, September 09, 2004 9:55 AM
> Development of a greedy algorithm, with a bit of recursion, may get you to
> where you need to be.  In this case, do something like the following:
> - Select the highest sell order that is <= the buy order.
> - Reduce the buy order by that amount
> - Continue selecting the sell orders that are <= the modified buy amount

If you're willing to pay some subscription fees, I THINK that this article
covers the algorithms for this class of problem:


Joshua Olson
Web Application Engineer
WAE Tech Inc.

More information about the thelist mailing list