Need help calculating shortest paths with data extracted from the database
Hello :) Need help please
if any one have an idea that can help me I would be grateful :)
So i should create a web service wich will communicate with my android application .in my android app the client choose two point start and arrival this two point will be send to my web service to find the bus that has the shortest path between them. i have a probleme in web service side
I try to use Dijkstra's algorithm to find the shortest path between two points. to test the Dijkstra algorithm I must extract data from a mysql database and not put it right into my algorithm.but i dont Khnow how can i do it
in my database I have two table that contains the bus route (bus num), code (station id), pt_arret (station name). and another table which contains location code (id station), latitude and longitude, and distance (is the distance between a station and the station which precedes.
(im sorry for the mistacke of spelling because i don't speak english very fluently)
thanks in advance:)
Re: Need help calculating shortest paths with data extracted from the database
Quote:
to test the Dijkstra algorithm I must extract data from a mysql database and not put it right into my algorithm.but i dont Khnow how can i do it
I don't understand the question (and BTW you've provided no true context to get a descent contextual answer)...you've got the shortest path algorithm and the data, construct the data into a format that the algorithm understands, unless of course I'm reading the statement above correctly in which case you don't want to put your data into the algorithm.
Re: Need help calculating shortest paths with data extracted from the database
Quote:
Originally Posted by
copeg
I don't understand the question (and BTW you've provided no true context to get a descent contextual answer)...you've got the shortest path algorithm and the data, construct the data into a format that the algorithm understands, unless of course I'm reading the statement above correctly in which case you don't want to put your data into the algorithm.
my probleme that i have 1000 node so i cant not put them into my algo. when i try to test dijkstra algorithme i think that i should extract data from my data base .for exemple i dont think that is a good idea to do like that
addLane("Edge_0", 0, 1, 85);
addLane("Edge_1", 0, 2, 217);....
SVP i need help
thanks in advance
Re: Need help calculating shortest paths with data extracted from the database
Quote:
Originally Posted by
olfa
my probleme that i have 1000 node so i cant not put them into my algo. when i try to test dijkstra algorithme i think that i should extract data from my data base .for exemple i dont think that is a good idea to do like that
addLane("Edge_0", 0, 1, 85);
addLane("Edge_1", 0, 2, 217);....
SVP i need help
thanks in advance
1000 Nodes is nothing, and I don't see why you cannot structure the data to feed into your algorithm. Pulling information as needed from the database is a lot of overhead, rather than pulling it all at once and mapping it. Another option - use a graph database meant for Graphs, such as Neo4j.