Knapsack Problem Without Value

G

geezle86

Hi,

I wanna ask about Knapsack. I do understand what Knapsack is about. But this one i faced is a different problem. There is no value. I mean, it's like this, for example.

I have 4 beams [X0, X1, X2, X3]. Each 1, 2, 2, 3 cm long. I want to make a new 6 cm long connected-beam from these 4 beams. I can make it from some of these. The output will print:

1, 2, 3 #(X0, X1, X3)

You understand what my problem is? Can you help me?

Sincerely,
 
G

Gary Herron

Hi,

I wanna ask about Knapsack. I do understand what Knapsack is about. But this one i faced is a different problem. There is no value. I mean, it's like this, for example.

I have 4 beams [X0, X1, X2, X3]. Each 1, 2, 2, 3 cm long. I want to make a new 6 cm long connected-beam from these 4 beams. I can make it from some of these. The output will print:

1, 2, 3 #(X0, X1, X3)

You understand what my problem is? Can you help me?

Sincerely,

No, I don't understand what your problem is.

You say there are no values but then you give 4 values (1, 2, 2, and 3),
and then you *solve* the Knapsack problem like this:
1, 2, 3 #(X0, X1, X3)

That looks like a fine solution to me.

Questions:

* Exactly *what* is the problem. If you tell us *carefully* what the
problem is, we may try to solve it.

* This is a Python list. Does your problem have anything to do with
Python?

* Is this a homework problem? We generally don't solve homework
problems here (since you don't learn anything that way), but we are
certainly happy to help you learn.

Gary Herron
 
G

geezle86

Hi,



I wanna ask about Knapsack. I do understand what Knapsack is about. But this one i faced is a different problem. There is no value. I mean, it's like this, for example.



I have 4 beams [X0, X1, X2, X3]. Each 1, 2, 2, 3 cm long. I want to make a new 6 cm long connected-beam from these 4 beams. I can make it from some of these. The output will print:



1, 2, 3 #(X0, X1, X3)



You understand what my problem is? Can you help me?



Sincerely,

No, this isnt homework. There is a website called Jollybee (Its available only in Bahasa) Here is the link if you dont believe me http://jollybee.binus.ac.id/oj/site/problemset/problem/code/HS10F/

Im just got bored and trying to have fun.

Not values like that, i mean, everywhere, I found the pseudocode only teach me with 2 variable. Mostly weight and its values ($). For short, this problem I faced is only the weight, no values($).

Hope you get it.
 
M

Mark Lawrence

Hi,



I wanna ask about Knapsack. I do understand what Knapsack is about. But this one i faced is a different problem. There is no value. I mean, it's like this, for example.



I have 4 beams [X0, X1, X2, X3]. Each 1, 2, 2, 3 cm long. I want to make a new 6 cm long connected-beam from these 4 beams. I can make it from some of these. The output will print:



1, 2, 3 #(X0, X1, X3)



You understand what my problem is? Can you help me?



Sincerely,

No, this isnt homework. There is a website called Jollybee (Its available only in Bahasa) Here is the link if you dont believe me http://jollybee.binus.ac.id/oj/site/problemset/problem/code/HS10F/

Im just got bored and trying to have fun.

Not values like that, i mean, everywhere, I found the pseudocode only teach me with 2 variable. Mostly weight and its values ($). For short, this problem I faced is only the weight, no values($).

Hope you get it.

Would you please read and action this
https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing the
double line spacing above, thanks.
 
S

Steven D'Aprano

Hi,

I wanna ask about Knapsack. I do understand what Knapsack is about. But
this one i faced is a different problem. There is no value. I mean,
it's like this, for example.

I have 4 beams [X0, X1, X2, X3]. Each 1, 2, 2, 3 cm long. I want to
make a new 6 cm long connected-beam from these 4 beams. I can make it
from some of these. The output will print:

1, 2, 3 #(X0, X1, X3)

You understand what my problem is? Can you help me?

No, this isnt homework. There is a website called Jollybee (Its
available only in Bahasa) Here is the link if you dont believe me
http://jollybee.binus.ac.id/oj/site/problemset/problem/code/HS10F/

Im just got bored and trying to have fun.

Not values like that, i mean, everywhere, I found the pseudocode only
teach me with 2 variable. Mostly weight and its values ($). For short,
this problem I faced is only the weight, no values($).

With only one value, I think it counts as a variation of the Change-
Making Problem:

http://en.wikipedia.org/wiki/Change-making_problem
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top