I read on
node.js's official site that
Node.js uses an event-driven, non-blocking I/O mode and highly scalable for network applications. And some thread I read that it is not for CPU intensive tasks. Is that mean that its not a good idea to use
node.js for solving problems like TSP, exact cover or graph coloring?
I read on
The default event model for Node.JS is single-threaded, cooperative multitasking. If you are I/O bound, Node.JS can simply accept new requests while yours is waiting for the database call to complete. But if you are CPU bound, you chew up clock cycles while other requests have to wait.
There are some intricacies, of course. You can find out in detail what they are and how they work in the article I link below.
Why you should use Node.JS for CPU-Intensive Tasks.
You can use
node.js for calculating whatever you want, even TSP problems or graph coloring. For example, I implemented a lot of Project Euler problems in
node.js is a "good-enough" choice for your use case, or if there are better alternatives is a completely different question. This depends a lot on non-functional factors like if you want to run your program as part of a web service, the number of concurrent computations you need to process, the need for multithreading, the requirement of reusing existing libraries, and so on.