I have a dijkstra-algoritm-program in php here. If you can send me an
adjacent matrix like this:

1 2 3 4 5
2 0 x x x
3 x 0 x x
4 x x 0 x
5 x x x 0


Or better a 2-dimensional array with (start, end, cost)

$map = array ( "1", "2", "10",
                      "2", "4", "10",
                      "3", "4", "10",
                      "4," "5", "5",
                      "5", "7", "8",
                      )

of your above problem I can re-check the output from my dijkstra-
program (no guarantee) for you.


On Oct 7, 3:23 pm, ligerdave <[email protected]> wrote:
> anyone here?
>
> On Oct 6, 10:47 am, ligerdave <[email protected]> wrote:
>
> > so i was reading <a href="http://en.wikipedia.org/wiki/
> > Dijkstra's_algorithm">wiki</a> on dijkstra's algorithm for finding
> > shortest path. i dont think article specifically define the
> > requirements of the graph in order to make the algorithm working
> > properly.(unless i missed something?)
>
> > for instance, in the graph below, the shortest path from 1to1 should
> > be 1>7>2>1. however, by following dijkstra's, you would get 1>4>9>1
> > because compared to 7, 4 is smallest among all direct vertices.
>
> >     1
> >   /   \
> > 2      9
> > |        |
> > 7      4
> >   \   /
> >     1
>
> > anyone knows the requirements, especially the ration of #of edges to
> > #of vertices?

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to