vault backup: 2022-10-18 12:39:16

This commit is contained in:
Jet Hughes 2022-10-18 12:39:16 +13:00
parent 59f8da0025
commit ec7da009fa

View File

@ -60,15 +60,17 @@ iterative: after k interations, know least cost path to k destinations
![](https://i.imgur.com/NfrM72Y.png)
## Dijkstra's algorithm
foward search algorithm
initialization
```
///initialization
N` = {u}
for all nodes v
if v adjacent to u
then D(v) = Cuv
else D(v) = infinity
//loop
loop until all nodes in N`
find W not in N` such that D(w) is a min
add w to N`
@ -78,6 +80,12 @@ loop until all nodes in N`
```
![example](https://i.imgur.com/zeR9DAI.png)
complexity:
- n nodes
- O(n)
# routing in the internet
# ICMP