maximise weights of sticks that can fit in a tube so that sum of lenghts is less than L

1 view (last 30 days)
1) We define a knaptube problem as follows: Given n sticks of length l1, l2, …, ln, weight w1, w2, …, wn, and a tube of total length L, find a subset of these sticks that can be lined up to fill the tube of length L while maximizing the total weight.
More formally, the objective and the constraint of the knaptube problem are follows, where si ranges over the indices of the selected sticks:
• Objective: Maximize the sum of the weights of the sticks in the tube
max (∑𝑤𝑠𝑖 ) (w subscript si) subject to
• Constraint: The sum of the lengths of the sticks in the tube must be less than or equal to L.
∑ 𝑙𝑠𝑖(l subscript si) ≤ 𝐿.
i am looking for ideas on how to approach this problem . Initially i thought its a simple problem but the more i think about this its looks a tough one .. please let me know on how to approach this .. any ideas are appreciated ..thanks

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!