The hope is that the remaining elements in the list l are similar in the sense that max(l)/min(l) is small, the heuristic could be improved one you try to make a trade off between max(l)/min(l) in the list and the difference between sum A and sum B.
HN user
skyrockect9
1 karma
Posts0
Comments3
No posts found.
The Easiest Hard Problem (2002) 11 years ago
The Easiest Hard Problem (2002) 11 years ago
The first heuristic algorithm that jumps to my mind to solve this problem goes like this: First sort the numbers into a list. Second take elements from the head of the list to construct a subset A. Third take elements from the tail to construct a subset B The second and third steps are done in such a way that the sum of A and B are nearly equal. Then one can hope that this procedure make the elements that are still in the list to be near identical and so allow you to construct nearly identical sums.
Can i Submit a story about myself? 11 years ago
Some minutes ago I submitted the question: What do you do when you get bored, and the HN team delete it, so perhaps you can submit your story but the reviewers can delete it.