Skip to content

Multithreading Routing Algorithm

jloh02 edited this page Dec 8, 2021 · 2 revisions

Multi-Threading

To ensure the routing is fast, for each src and des pair, a thread is created. The total execution time is also limited in the PathfinderExecutor.java file using Java's ExecutorService. When a path is found, it is added synchronously to a static array of Routes in PathfinderExecutor.java. This allows for further optimization in the original Dijkstra code. A sub-route may now be cancelled if the current time is more than the 3rd fastest route.

Return Routes (To be implemented)

The routes are then converted to strings to be returned to the client.

Clone this wiki locally