mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-27 06:44:07 -06:00
vault backup: 2022-10-18 12:39:16
This commit is contained in:
parent
59f8da0025
commit
ec7da009fa
@ -60,15 +60,17 @@ iterative: after k interations, know least cost path to k destinations
|
||||

|
||||
|
||||
## 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`
|
||||
|
||||
```
|
||||
|
||||

|
||||
|
||||
complexity:
|
||||
- n nodes
|
||||
- O(n)
|
||||
|
||||
# routing in the internet
|
||||
|
||||
# ICMP
|
||||
Loading…
Reference in New Issue
Block a user