MHB Solving the Fractional Knapsack Problem - Wave and Thinking

  • Thread starter Thread starter evinda
  • Start date Start date
  • Tags Tags
    fractional
Click For Summary
SUMMARY

The discussion centers on the fractional knapsack problem and the application of a specific algorithm to solve it. The participant raises a question regarding the manipulation of the variable 'w' in the algorithm, specifically why it is not adjusted to 'w + (W - w) / S.weight'. The reasoning provided indicates that this operation would incorrectly combine a dimensionless number with a unit of weight, which is a critical error in algorithm implementation.

PREREQUISITES
  • Understanding of the fractional knapsack problem
  • Familiarity with algorithm design and analysis
  • Knowledge of variable manipulation in programming
  • Basic concepts of dimensional analysis in mathematics
NEXT STEPS
  • Research algorithms for the fractional knapsack problem
  • Study dimensional analysis in programming contexts
  • Explore common pitfalls in variable manipulation in algorithms
  • Learn about optimization techniques in algorithm design
USEFUL FOR

Computer science students, algorithm enthusiasts, and software developers interested in optimization problems and algorithm implementation.

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.
 
If there are an infinite number of natural numbers, and an infinite number of fractions in between any two natural numbers, and an infinite number of fractions in between any two of those fractions, and an infinite number of fractions in between any two of those fractions, and an infinite number of fractions in between any two of those fractions, and... then that must mean that there are not only infinite infinities, but an infinite number of those infinities. and an infinite number of those...

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