× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



This is one of the "NP complete" problems. It is very simple to solve,
but the number of combinations grows exponentialy.

If you can find an efficient solution, you will deserv a "Nobel price"

On 09/29/2014 08:17 PM, Roger Harman wrote:
Put your math hats on......

I'm looking at a means to *attempt* to auto-match payments to invoices. We do not want to apply payments to oldest first and end up with a partial payment or credit leftover.

Pick an arbitrary number of invoices for the attempt - say 10.

Any combination of 1 or more of these 10 invoices that total the payment amount would be considered a match.
Could be invoice 1, or 2, or.... Could be invoices 2 and 5 and 8..... etc.

I assume it's going to have to be a brute force approach but I'm stumped on the total # of possible matches. Combinations & permutations I understand (3 out of 10, etc) but this "1 or 2 or (1 and 2) or (2 and 5 and 8)" is giving me a mind block. I do know it's a big number and I'll likely cut back the sampling size.

Any suggestions or clarifications would be very welcome.

Thanks.



Roger Harman


COMMON Certified Application
Developer – ILE RPG on IBM i on Power







-- Este e-mail fue enviado desde el Mail Server del diario ABC Color --
-- Verificado por Anti-Virus Corporativo Symantec --

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.