Search code examples
javascriptgenetic-algorithmtraveling-salesman

Where to run javascript to solve tsp with GA


I have programmed a tsp-solver with genetic algorithm, but i have to solve it for 11000 cities. In the browser it gets very slow and hangs. How can I run javascript the fastest way?

Maybe with node.js in the Mac terminal or with node.js on an amazon EC2 server or with firebase cloud functions?

Thanks a lot


Solution

  • It is very hard to solve with js. You need to run your code near by CPU. I prefer C,C++ with correct parameters. Then you can build engine as service. If speed not your first criteria, you can use server side technologies look like nodejs, php, .net. You need caching mechanism for saving solutions. If you plan to use AWS, you can check AWS lambda services. I prefer use own server without virtual instance. Virtual instance has low memory access speed. You need to make a lot of test for determining your correct platform.