Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm going to be describing my solution using the <strong><a href="http://en.wikipedia.org/wiki/A*_search_algorithm" rel="nofollow noreferrer">A* Algorithm</a></strong>, which I consider to be an extension (and an improvement -- please don't shoot me) of Dijkstra's Algorithm that is easier to intuitively understand. The basics of it goes like this:</p> <ol> <li>Add the starting path to the priority queue, weighted by distance-so-far + minimum distance to goal</li> <li>Every iteration, take the lowest weighted path and explode it into every path that is one step from it (discarding paths that wrap around themselves) and put it back into the queue. Stop if you find a path that ends in the goal.</li> </ol> <p>Instead of making your weight simply distance-so-far + minimum-distance-to-goal, you could use two weights: Stops and Distance/Time, compared this way:</p> <p>Basically, to compare:</p> <ul> <li>Compare stops first, and report this comparison if possible (i.e., if they aren't the same)</li> <li>If stops are equal, compare distance traveled</li> </ul> <p>And sort your queue this way.</p> <p>If you've ever played <a href="http://en.wikipedia.org/wiki/Mario_Party" rel="nofollow noreferrer"><strong>Mario Party</strong></a>, think of stops as Stars and distance as Coins. In the middle of the game, a person with two stars and ten coins is going to be above someone with one star and fifty coins.</p> <p>Doing this guarantees that the first node you take out of your priority queue will be the level that has the least amount of stops possible.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload