School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,145 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,724 people online right now. Registration is fast and FREE... Join Now!




Need Algorithim name for a problem

 

Need Algorithim name for a problem

Some1Wow

10 Sep, 2009 - 11:58 PM
Post #1

New D.I.C Head
*

Joined: 10 Sep, 2009
Posts: 5

Hello everyone

I did not take an algorithims course so I need your help

Is there an algorithim to solve this problem? .

if I have a set of items and each item has a subset of items with a value.
I want to find the best solution , have an item from each subset where the sum of the items <= a given number

Example:
I have 3 items:
item1 has > p 1 : value =3
p 2 : value = 4

item2 has > p1:value = 5
p2 : value =4

item3 has > p1:value = 3
p2 : value =6

and I have a given number 12
Best Solution : item1 : p2 - item 2 : p1 -item3: p1
Sum=12 <=12

I want an algorithim name that solves this problem similar to Knapsack - Sum of subset .....etc
or any algorithim that helps me solve this solution

I just need the name of algorithim not the code!


Thanks

This post has been edited by Some1Wow: 11 Sep, 2009 - 12:04 AM

User is offlineProfile CardPM
+Quote Post


Kanvus

RE: Need Algorithim Name For A Problem

11 Sep, 2009 - 08:23 AM
Post #2

D.I.C Regular
Group Icon

Joined: 19 Feb, 2009
Posts: 451



Thanked: 39 times
Dream Kudos: 50
My Contributions
the way you're explaining it is hard to visualize
User is offlineProfile CardPM
+Quote Post

Neumann

RE: Need Algorithim Name For A Problem

11 Sep, 2009 - 08:56 AM
Post #3

I can judge a book by its cover
Group Icon

Joined: 8 Jul, 2009
Posts: 686



Thanked: 93 times
Dream Kudos: 225
My Contributions
Not every algorithm has a name. You are asking for something that may not exist.

This does seem to be very similar to the Knapsack problem, except that you can only take a single element from each subset, at most. If I were you, I would check out the algorithm for the Knapsack problem to see if I can tweak it to work with your case. A simple brute-force can also solve this.

This post has been edited by Neumann: 11 Sep, 2009 - 08:57 AM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 03:41PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month