dcsimg
please help me for this Question
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Aditi_dubey
Posted On:   Wednesday, August 30, 2006 06:16 AM

I am new to java I have got a problem .The problem is : We are having airoutes available that is :from Bangalore to Delhi,Mumbai,chennai and Hyderabad Delhi is also connected to mumbai ,chennai,hyderabad and Bangalore.Other cities to which flight s are available , They are : lucknow,srinagar,kanpur,KolKatta 1 What will be the route if I want to travel from bangalore to Kanpur. 2.The program should be as such that I can easily add new cities and routes and get the path from anywhere to anywhere All the possible paths should be displayed between the source city and destination city. Can anybody please help me for this . Please use html tags to format code blocks.    More>>

I am new to java I have got a problem .The problem is :
We are having airoutes available that is :from
Bangalore to Delhi,Mumbai,chennai and Hyderabad
Delhi is also connected to mumbai ,chennai,hyderabad and Bangalore.Other cities to which flight s are available , They are : lucknow,srinagar,kanpur,KolKatta


1 What will be the route if I want to travel from bangalore to Kanpur.
2.The program should be as such that I can easily add new cities and routes and get the path from anywhere to anywhere


All the possible paths should be displayed between the source city and destination city.
Can anybody please help me for this .
Please use html tags to format code blocks.

   <<Less

Re: please help me for this Question

Posted By:   Vijay_Kumar  
Posted On:   Friday, September 1, 2006 08:15 AM

You can represent the data as graph
There are various algorithms available to find the shortest path/ all available paths between nodes, in your case the nodes will be places like Bangalore , Delhi etc.

Vijay

Re: please help me for this Question

Posted By:   Robert_Lybarger  
Posted On:   Wednesday, August 30, 2006 08:58 AM

Ahh... path finding. You should try google for the "A* path finding algorithm" (perhaps try "A star" instead of "A*" when asking a search engine, though usually it is "A*" in a book). Granted, that's just an algorithm and not a full program, but that's probably your hardest part... given an arbitrary start and end point and an arbitrary number of nodes, what is the "fastest" route. (Though be careful to note that "fastest" can have many meanings... shortest time, shortest distance, fewest layovers, minimum weather effects, etc.)

About | Sitemap | Contact