First, peace be upon you. I am a 16-year-old programmer, and I tried to solve the well-known Subset Sum problem. Before starting the definition, the speed of the algorithm is approximately O(log N).
How it works briefly:
The Core Concept: I take the Target and add its inverse to the equation, trying to zero it out.
Method of Zeroing Out: Done by converting numbers into positive and negative categories (tens, hundreds, thousands, etc.) to facilitate and speed up the search.
Outlier Filtration: A category is considered an outlier if the largest number in it is greater than the sum of all categories from the opposite side combined.
I had no prior knowledge of approximation algorithms or division into categories; everything I reached was on my own during this past month.
I would highly appreciate it if you could review my approach, give me your honest feedback, and help me improve it! I will drop the GitHub repository link https://github.com/1dev1a/Subset_Sum_Heuristic_Algorithm_-O-log-N-
Top comments (1)
Read it