<!-- extremely awkward mashup pseudocode:
C++, Java, Python, Lisp, HTML, TI-Basic, English, and randomness
I don't know why I'm bothering to say this.
-->
defun push(a, b):
-assert a.h = b.h +1
-assert a not in {s, t}
-f(a, b) += min(a.e, c(a, b))
defun lift(a):
-assert for b in V, c(a, b) = 0 or b.h >= a.h
-assert a not in {s, t}
-assert(?) a.e > 0
-a.h = min((b.h for b in V if c(a, b) > 0)) + 1
defun discharge(a):
-assert a not in {s, t}
-xyzzy:
--while a.e > 0:
---for b in V:
----if c(a, b) > 0 and a.h = b.h + 1:
push(a, b)
----if a.e == 0:
break xyzzy
---lift(a)
for a in V minus {t}:
-a.h = 0
s.h = size(V)
for a in V:
-f(s, a) = c(s, a)
loop:
-for a in V minus {s, t}:
--discharge(a)
-flag = false
-for a in V minus {s, t}:
--if a.e > 0:
---flag = true
---break
-if not flag:
--break
(C) Okay, now there's TI-Basic.
This post has been edited 2 times. Last edited by math_explorer, Aug 19, 2011, 9:36 AM