MHB Solving the Fractional Knapsack Problem - Wave and Thinking

  • Thread starter Thread starter evinda
  • Start date Start date
  • Tags Tags
    fractional
Click For Summary
The discussion revolves around an algorithm for solving the fractional knapsack problem. A key question raised is why the variable 'w' is not adjusted to include the term (W-w)/S.weight in the else case. This adjustment would improperly combine a dimensionless number with a weight measurement in pounds. The participants are analyzing the implications of this adjustment on the algorithm's logic. Understanding these nuances is crucial for accurately implementing the fractional knapsack solution.
evinda
Gold Member
MHB
Messages
3,741
Reaction score
0
Hello! (Wave)

I found the following algorithm for the fractional knapsack problem.

fractional_knapsack.PNG
Why at the case else, we do not change the variable w to w+(W-w)/S.weight? (Thinking)
 
Physics news on Phys.org
evinda said:
Why at the case else, we do not change the variable w to w+(W-w)/S.weight?
That would be adding a dimensionless number to pounds.
 
First trick I learned this one a long time ago and have used it to entertain and amuse young kids. Ask your friend to write down a three-digit number without showing it to you. Then ask him or her to rearrange the digits to form a new three-digit number. After that, write whichever is the larger number above the other number, and then subtract the smaller from the larger, making sure that you don't see any of the numbers. Then ask the young "victim" to tell you any two of the digits of the...

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 30 ·
2
Replies
30
Views
5K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 22 ·
Replies
22
Views
2K
  • · Replies 18 ·
Replies
18
Views
3K
Replies
1
Views
2K