User:Gjvnq/Ranked Pairs Algorithm

Algorithm
algorithm ford-fulkerson is input: Graph G with flow capacity c, source node s, sink node t output: Flow f such that f is maximal from s to t (Note that f(u,v) is the flow from node u to node v, and c(u,v) is the flow capacity from node u to node v) for each edge (u, v) in GE do f(u, v) ← 0 f(v, u) ← 0 while there exists a path p from s to t in the residual network Gf do let cf be the flow capacity of the residual network Gf        cf(p) ← min{cf(u, v) | (u, v) in p} for each edge (u, v) in p do f(u, v) ← f(u, v) + cf(p) f(v, u) ← −f(u, v)    return f

algorithm victory-strengh-votes is input: Ordered pair (a, b) where a and b are the number of votes the winner and the loser candidate recieved, respectively. output: A fraction between zero and one representing the victory of the strength. ∆ ← a - b total ← a + b return ∆ / total