I'm developing a Java application where I have to implement Shortest path algorithm (dijkstra's).
I've stored the details of nodes in database.

But my problem is that the number of nodes is very large (1000+) and taking all the nodes into consideration will increase the time and space consumption of the application.

Also taking such large number of nodes into consideration will be inefficient as many nodes will be irrelevant in finding the shortest path.

Hence, I'm looking for a solution this problem.

I don't want the code, I just want the idea/method to solve it.
So, please suggest me some method.

Hi,

I am pasting some useful links which help you to solve the algorithm.

http://www.dgp.toronto.edu/people/JamesStewart/270/9798s/Laffra/DijkstraApplet.html

Read another article at http://renaud.waldura.com/doc/java/dijkstra/


and


http://www.delphiforfun.org/Programs/Math_Topics/ShortestPath.htm

Thank you for the reply. But still my problem is not solved.
I want a method of finding the shortest distance which does not consider all the nodes(1000+) in finding the path.

Thank you for the reply. But still my problem is not solved.
I want a method of finding the shortest distance which does not consider all the nodes(1000+) in finding the path.

You said you had already selected the method and that it was Dijkstra's Method. Also, how can you not consider all the nodes? If you have 1000 nodes and you only look at 999 of them, how do you know that the 1000th node, the one you don't look at, isn't one of the nodes on the shortest path?

This article has been dead for over six months. Start a new discussion instead.