Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Software Design and Algorithms (http://www.programmingforums.org/forum64.html)
-   -   How to use Knapsack problem? (http://www.programmingforums.org/showthread.php?t=13179)

scm007 May 20th, 2007 5:06 PM

How to use Knapsack problem?
 
Basically I have a set, O consisting of N 3-tuples, <X, Y, Z>. I am trying to construct a set O' subject to the constraint that sum of all X's in O' is within some range X'Range, the average of all Y's is within some range Y'Range, and the sum of all Z's is within some range Z'Range.

This seems like a perfect situation for the knapsack problem does it not? However I am a little confused about how to do this.

Pseudocode would be great!

Steve


All times are GMT -5. The time now is 2:25 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC