Search:

Type: Posts; User: helloworld922

Search: Search took 0.07 seconds.

  1. Replies
    13
    Views
    4,441

    Re: CHALLENGE - find the shortest path

    You need to make sure that the compiler has access to the classes. There are several ways to do this depending on how you're compiling your code as well as what they're providing you, such as source...
  2. Replies
    13
    Views
    4,441

    Re: CHALLENGE - find the shortest path

    It's the exact same Dijkstra's algorithm. I have no idea what the treeWeight method is (I didn't look at the code), but I'm pretty sure that getShortestPath() returns a list of nodes which comprise...
  3. Replies
    13
    Views
    4,441

    Re: CHALLENGE - find the shortest path

    There are a few different ways to represent graphs (well, there are actually more than two but these are probably the easiest two): via a matrix, or via a jagged list. Without going into too much...
  4. Replies
    13
    Views
    4,441

    Re: CHALLENGE - find the shortest path

    fi is short-hand for "end if" (or a backwards if).

    Line 3 sets the shortest distance from any other node to the start node at infinity (the furthest distance away). The reason for this is so any...
  5. Replies
    13
    Views
    4,441

    Re: CHALLENGE - find the shortest path

    If you saw the animation on Wikipedia, just replace all the edge costs with 1 and you'll have an un-weighted map. Their pseudo-code can be used verbatim and all you need to do is pass in the correct...
  6. Replies
    13
    Views
    4,441

    Re: CHALLENGE - find the shortest path

    That's simple, just run Dijkstra's algorithm using an un-weighted map (every connection is weighted the same).
Results 1 to 6 of 6