$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Juho Eskeli (juho.eskeli_at_[hidden])
Date: 2007-09-23 05:14:57
Hi, I've got a following problem: is it possible to add extra cost to edge
weight if changing direction? What I mean is I have created a map of vertexes
with weights and each vertex has edges to general cardinal points
(n,ne,e,se,s,sw,w,nw). Now that the algorithm has found a shortest distance from
origin to, let's say southeast. Now all the other edges than the one going
southeast are penalized.
Figure of the situation:
|
-o- <- starting point
|
Least distance > o-o <- Penalized
|
o <- Not penalized, moving to south
o denotes a vertex, - and | are edges
I presume dijkstra visitor should be used for this, but I'm too much of a
newbie. Any help appreciated.