I have solved the problem.
I used Dijkstra's algoritm itself but i added some conditions.
In the dijktra's algorithm, after settling a node it wont take that node again in the openlist, but added that.
But i didnt took the node that is already present in the path.....
and hence solved the problem.
thank u all.
Welcome to the forum. Please don't post in threads that are long dead and don't hijack other threads. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.
I'm locking this thread now.