diff --git a/Ideas.md.gpg b/Ideas.md.gpg index f5786b4..03c0275 100644 Binary files a/Ideas.md.gpg and b/Ideas.md.gpg differ diff --git a/tech/Bellman-Ford.wiki b/tech/Bellman-Ford.wiki new file mode 100644 index 0000000..b6c2494 --- /dev/null +++ b/tech/Bellman-Ford.wiki @@ -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) + + }}} diff --git a/tech/algorithms.wiki b/tech/algorithms.wiki index 798c01b..c70e28c 100644 --- a/tech/algorithms.wiki +++ b/tech/algorithms.wiki @@ -39,6 +39,7 @@ Different ways to store and operate on data, with differing efficiency * [[BFS]] * [[DFS]] * [[Dijkstra]] +* [[Bellman-Ford]] === Strings ===