Help needed regarding a greedy problem

Revision en1, by MotaSanyal, 2020-05-03 10:13:11

Hello everyone!!

Consider the Fitting Shelves Problem

The solution : We can consider all multiples of "m" less than equal to "w" to find the minimum remaining space.

My claim : We only have to consider the highest or second highest multiple of "m" to find the minimum remaining space.

Actually I have not been able to prove this but it works correctly on most of the inputs. So, any prove as to why this will work correctly or any contradictory test case that fails with this approach will be highly appreciated.

Thanks in advance :)

Tags #help, #greedy, #optimization

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English MotaSanyal 2020-05-03 10:13:11 897 Initial revision (published)