Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Need help calculating shortest paths with data extracted from the database

  1. #1
    Junior Member
    Join Date
    May 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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


  2. #2
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,104
    Thanks
    169
    Thanked 780 Times in 726 Posts
    Blog Entries
    5

    Default Re: Need help calculating shortest paths with data extracted from the database

    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.

  3. #3
    Junior Member
    Join Date
    May 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Need help calculating shortest paths with data extracted from the database

    Quote Originally Posted by copeg View Post
    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

  4. #4
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,104
    Thanks
    169
    Thanked 780 Times in 726 Posts
    Blog Entries
    5

    Default Re: Need help calculating shortest paths with data extracted from the database

    Quote Originally Posted by olfa View Post
    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.

Similar Threads

  1. how to searching data from database using servlet??
    By mr.nash in forum Java ME (Mobile Edition)
    Replies: 1
    Last Post: December 21st, 2011, 02:09 PM
  2. multiple access to same data in database
    By the light in forum JDBC & Databases
    Replies: 1
    Last Post: August 23rd, 2011, 10:19 AM
  3. CHALLENGE - find the shortest path
    By ice in forum Algorithms & Recursion
    Replies: 13
    Last Post: January 20th, 2011, 11:30 AM
  4. [SOLVED] Passing data to a MySQL database
    By JDyson in forum JDBC & Databases
    Replies: 1
    Last Post: December 1st, 2010, 12:31 PM
  5. [SOLVED] Get Data From Database MySQL using ComboBox
    By Simple in forum Java Theory & Questions
    Replies: 2
    Last Post: June 4th, 2010, 02:45 AM

Tags for this Thread