MHB Solving the Fractional Knapsack Problem - Wave and Thinking

  • Thread starter Thread starter evinda
  • Start date Start date
  • Tags Tags
    fractional
AI Thread 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.
 

Similar threads

Replies
1
Views
1K
Replies
30
Views
5K
Replies
2
Views
2K
Replies
1
Views
1K
Replies
11
Views
2K
Replies
22
Views
2K
Replies
18
Views
3K
Back
Top