Skip to main content
added 18 characters in body
Source Link
nir shahar
  • 11.7k
  • 3
  • 16
  • 35

Take a look at the simplest possible example: Our graph has only two nodes: $s,t$, and a single edge between them.

In this example, it won't matter what is the cost of this single edge (it can be negative), and Djikstra will always return the only single path between $s$ and $t$: which is directly $s\rightarrow t$.

Take a look at the simplest possible example: Our graph has only two nodes: $s,t$, and a single edge between them.

In this example, it won't matter what is the cost of this single edge (it can be negative), and Djikstra will always return the only single path between $s$ and $t$: $s\rightarrow t$.

Take a look at the simplest possible example: Our graph has only two nodes: $s,t$, and a single edge between them.

In this example, it won't matter what is the cost of this single edge (it can be negative), and Djikstra will always return the only single path between $s$ and $t$: which is directly $s\rightarrow t$.

Source Link
nir shahar
  • 11.7k
  • 3
  • 16
  • 35

Take a look at the simplest possible example: Our graph has only two nodes: $s,t$, and a single edge between them.

In this example, it won't matter what is the cost of this single edge (it can be negative), and Djikstra will always return the only single path between $s$ and $t$: $s\rightarrow t$.