my computer tried to calculate paths 9.33×10^157 times.

Posted by silicisbits@reddit | Python | View on Reddit | 10 comments

so I was creating my first tsp algorithm, without any optimizations just calculate every possible path, I got it working for 4 paths then I tried to increase the number of points to 100, and if you don't know my computer had to calculate 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000 paths and find the closest path between them, some time after I ran the code I saw a pop up that said "you have ran out of application memory" with all the apps that were currently running, python alone was using around 45 gigs of memory, but I only had 8 GIGS OF MEMORY, moral of the story? don't run code without knowing how resource intensive it is.