3 ms·
Because this is a new account Im nearly frozen from replying. I have updated the algorithm so that the RAM space is a bit over the size of the set. This also dr
by zzxxyyaabbcc 5y ago
Because this is a new account Im nearly frozen from replying. I have updated the algorithm so that the RAM space is a bit over the size of the set. This also drastically cut down on computation time. E.g. A set of 200 integers takes 2MB of RAM. I used a 1+2+...+200 set for testing (since it is known to have tons of solutions) with a goal of 1000. Im at 360,000,000 solutions found 10 minutes into executing.
The best existing algorithms out there can only handle 50-100 integers according to the wikipedia page. Basically, the time complexity of this algorithm is (roughly) limited to the number of possible solutions. If that's what makes the subset problem NP-Complete, then I guess I didnt solve anything, other than eliminating most of the fat in all the existing solutions.
>Your runtime is probably (2^n)^C where n is the number of bits in the input and C is some constant.
If n is the set of all the numbers, then I would not have been able to create a 2^(80*4*8) solution in my lifetime (ref: paste bin). If n is the number of bits in an int 2^(4*8), how would that explain the time it took to calculate the solutions in the paste bin link? I dont have a traditional CS education
gus_massa:
I will try more complicated sets. I also couldnt find any existing sets to test against. A set of 1000 numbers is an order of magnitude higher than the best algorithms out there. If there are a lot of solutions in that set, then it will take a long, long time even with my algorithm.