of course this is possible. store the new min dist for each node if it
is lower than the old min dist. store next postbox node id if wanted.
all a matter of time and memory :-)


On Wed, 2009-07-15 at 13:30 -0400, [email protected] wrote:
> >> only needs an dijkstra algorithm and some more lines of code.
> >
> > sounds so simple... ;-)
> >
> > I had a look at the wikipedia page
> > (http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) and that would look
> > to make sense.
> >
> 
> As you may have noticed I've actually had a relatively amount of success
> with this, but my brain is off on the 'multiple targets' question.
> 
> Is it valid to repeat the dijkstra algorithm with multiple 'target' nodes,
> so you could find the shortest path to (say) any playground? Target nodes
> could auto-magically be extracted from OSM file based on tags.
> 
> Is this as simple as keeping the 'found' state in a seperate variable for
> each node (rather than using the distance variable as a found state)?
> 
> Then you could 'walk' from each target node looking at 'found' state and
> 'distance' to determine whether this node was closer to new target than
> the previous, if it were you adjust the 'found' to indicate which target
> was closer, set your distance and then continue to walk.
> 
> You'd also have a record (in the 'found' state) of which target was closer.
> 
> Does this sound correct?
> Simon.
> 
> 
> 
> 
> _______________________________________________
> talk mailing list
> [email protected]
> http://lists.openstreetmap.org/listinfo/talk


_______________________________________________
talk mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/talk

Reply via email to