The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs | Towards Data Science
towardsdatascience.comΒ·16h
πŸ“ŠOptimization
Preview
Report Post

, I will present a solution to the Subset Sum Problem, which has linear time complexity O(n), if all the β€˜n’ input values are β€œclose enough” to each other. We will see shortly what that condition actually means, as well as why it might often be kept (or almost kept) in practice. For the inputs that are β€œalmost close” to each other, the algorithm still has a certain probability of working fast enough.

This article is organized in the following way:

  • In chapter 1, we will recall the Subset sum problem and show probably the most trivial solution to it, based on the brute-force technique.
  • Chapter 2 recalls the class of NP-complete problems and how the Subset sum problem is related to it.
  • Chapter 3 reviews the commonly used solution based on Dynamic programming technique, …

Similar Posts

Loading similar posts...