Geoscience Reference
In-Depth Information
Code Sample 1. Dijkstra algorithm (modi
ed from: [ 4 ])
When calculating distance of new node there is necessity to take into account all
the possible paths to this node and add the new distance to all of them (Code
Sample 2).
Code Sample 2. Calculation of distances for node
The next step in the algorithm is comparison of the calculated distance with the
distances already known for the node. Possibility and necessity is calculated
according to Eqs. ( 2 ) and ( 3 ). There are 3 possible outcomes of the comparison the
new values to the already known distances. First the necessity result may be equal
to 1. Which means that it is de
nitely bigger, in such case the value is of no interest
because the alternative is for sure shorter. If the values of necessity and possibility
are both equal to zero than the value is de
nitely smaller and it should replace the
[
\
originally recorded values. If Q X
Y ; 1
Y ; 1
N Y
1, that is and
indicator, that there is overlap between two values and there is no clear preference
0 and
Search WWH ::




Custom Search