With Reference to my earlier problem:
everything is working fine now - but got one more small problem...
When returning the final array from the algorithm ($path)...it is returned as one string, so:
$paths = dijkstra($neighbors, "$From");
while(list($vertex, $path) = each($paths))
if ($vertex=="$To") {
echo "Going From Point $From to $vertex: <BR>", implode(", ", $path), "<br>";
};
Returns:
Going From Point A to F:
12, E, D
I need to be able to break the array down (as in 12, 3 and D) into seperate strings for presentation purposes. The array may include more items depending on the path taken....
Anybody know how?
Cheers
Bert