I am currently working on my graduation project, a full-stack web service for minimum arrival time calculation for public transport. I have done the frontend side with React. Also using MongoDB for my city's data for bus/metro stops and arrival-destination times of them. I have to apply a complicated Shortest Path Algorithm for a directed-weighted graph (for all stops and transportation types of the city). Can I use Node.js or ExpressJS for this complex algorithm, or should I make the backend side with C++ or such-like languages? I would be very appreciative if you can help me, thanks.
If you have a web server that talks to a database, then you should use a suitable high-level language. C++ is technically capable of serving as a back-end (I have done it), and there are even server frameworks for it, but safe processing of complex data is harder with C++ and it is not a popular choice for servers, so you will not find as much help when there are problems. Yes, you can use Node.js for this (or maybe Python if the algorithm involves lots of vector operations or other advanced data types) because standard command-flow algorithms can be implemented in any major language. It should be whichever language you understand well enough to use safely (it is not possible to use ExpressJS for the algorithm because it is actually a Node.js framework). If performance becomes critical, you can use C++ (or one of its safer low-level competitors) just for the slow part.
You should use NodeJS to code up your shortest-path algorithm. Your task is computationally very light compared to tasks which might need a C++ implementation (e.g. speech recognition). Because it may be computationally heavy compared to most web-stack transactional work, you will want to run it in an asynchronous task queue service, e.g. RabbitMQ or Bee-Queue, fronted by an ExpressJS service.
Also, I would recommend starting with a simple Shortest Path Algorithm (e.g. Dijkstra or A*, depending on whether you have admissible path-finishing estimates). Do not make it complicated until you have reliable field data that demonstrates that your simple algorithm isn't adequate.