[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
RE: [sqr-users] Need Some help in a SQR Select
- Subject: RE: [sqr-users] Need Some help in a SQR Select
- From: "George Jansen" <GJANSEN@aflcio.org>
- Date: Thu, 15 Dec 2005 08:33:41 -0500
- Delivery-date: Thu, 15 Dec 2005 08:36:37 -0500
- List-id: "This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions." <sqr-users.sqrug.org>
There are a number of good answers for the two-row case, already provided by
John Tucker among others. For the general case, I quote _Introduction to
Algorithms_, Cormen, Leiserson, Rivest 1996, section 37.4
"An instance of the subset-sum problem is a pair (S,t) where S is a set {x1,
x2, ...,xn} of positive integers and t is a positive integer. This decision
problem asks whether there exists a subset of S that adds up exactly to the
target value t. This problem is NP-complete."
The text goes on to give a polynomial-time approximation algorithm, but the
general case is exponential in cost.
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users