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.


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

Results 1 to 3 of 3

Thread: CONFUSION - Breadthfirst search

  1. #1
    Junior Member
    Join Date
    Apr 2011
    Thanked 0 Times in 0 Posts

    Default CONFUSION - Breadthfirst search

    hi there,

    For an assignment at my uni I have to create a program that takes a train network and calculates the shortest path from one station to the other. The line the station is on is not relevant.

    so out put will just be a list of stations the user must go through to get to the destination,

    I am thinking of doing Breadthfirst search to accomplish this. what type of graph is going to be needed?

    im guessing undirected unweighted graph....do you need to have a adjacencylst? or matrix?
    thanks guys

  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Thanked 833 Times in 772 Posts
    Blog Entries

    Default Re: CONFUSION - Breadthfirst search

    See Shortest path problem - Wikipedia, the free encyclopedia , in particular Dijkstra's algorithm and Floyd-Warshall algorithm. These links will hopefully get you started.

  3. #3
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    My Mood
    Thanked 82 Times in 78 Posts
    Blog Entries

    Default Re: CONFUSION - Breadthfirst search

    That depends what your problem specification is, if it is directed and weighted graph, or directed, unweighted, or undirected weighted or undirected unweighted graph. Depends upon the problem. And if not mention, i';; recommend you to go for undirected unwieghted graph for working fast but if you really want to enjoy doing programming, do directed, weighted graph or undirected, weighted graph and find the smallest and efficient path.

Similar Threads

  1. Package confusion
    By caesius in forum What's Wrong With My Code?
    Replies: 4
    Last Post: March 21st, 2011, 11:08 PM
  2. Method & Class confusion
    By jog98 in forum Object Oriented Programming
    Replies: 8
    Last Post: December 8th, 2010, 11:28 AM
  3. help 2d array confusion
    By Macgrubber in forum What's Wrong With My Code?
    Replies: 4
    Last Post: November 29th, 2010, 04:30 PM
  4. ArrayList confusion
    By Stormin in forum Collections and Generics
    Replies: 7
    Last Post: August 13th, 2010, 04:58 PM
  5. Confusion about DAO in Three-Tier Architecture!
    By maven in forum Object Oriented Programming
    Replies: 1
    Last Post: July 24th, 2010, 08:09 AM

Tags for this Thread