Update for 28-09-22 16:45

This commit is contained in:
Tyler Perkins 2022-09-28 16:45:01 -04:00
parent f6d480141a
commit 40d8f9fdf9
3 changed files with 29 additions and 0 deletions

Binary file not shown.

28
tech/Bellman-Ford.wiki Normal file
View File

@ -0,0 +1,28 @@
= Bellman Ford =
Bellman ford is an algorithm for finding the shortest path from some node to
all other nodes in a weighted graph
== PsuedoCode ==
Input: directed graph _G=(V,E)_;
Edge lengths contained in the set _E_ with no negative cycles; Edge is _e_;
_s_ contained in _V_;
Output: For all verticies _u_ reachable from _s_, `dist(u)` is set to the
distance from _s_ to _u_
{{{
for all u in V:
dist(u) = inf
prev(u) = null
dist(s) = 0
repeat |V| - 1 times:
for all e contained in E:
update(e)
update((u,v) in e):
dist(v) = min(dist(v), dist(u) + length of dist between u and v)
}}}

View File

@ -39,6 +39,7 @@ Different ways to store and operate on data, with differing efficiency
* [[BFS]]
* [[DFS]]
* [[Dijkstra]]
* [[Bellman-Ford]]
=== Strings ===