in reply to The Matrix

This looks like a pretty straightforward application of Dijkstra's algorithm. However, details aren't quite clear. If I jump five columns to the right, how many columns am I using? Two or five?

Abigail

Replies are listed 'Best First'.
Re: Re: The Matrix
by nosbod (Scribe) on Nov 25, 2002 at 14:43 UTC
    ah maybe should have made that more clear. If you jump five columns to the right you would be using two columns not 5. Is Dijkstra's algorithm appropriate still?

    thanks

      No, I don't think you can use Dijkstra's algorithm in this case. Because in Dijkstra's algorithm, if you can go from one node to another in say, two steps, it doesn't matter which two steps you take, and furthermore, the best overall solution will not take three steps between those nodes. But that's not true in this matrix case.

      In fact, this problem might even be NP-complete.

      Abigail