Skip to content

Instantly share code, notes, and snippets.

@bantmen
Created February 10, 2015 22:20
Show Gist options
  • Select an option

  • Save bantmen/e777bc7b7c8eb986b26b to your computer and use it in GitHub Desktop.

Select an option

Save bantmen/e777bc7b7c8eb986b26b to your computer and use it in GitHub Desktop.
made_change = True
While made_change: # continue while any change is possible
made_change = False # see if any changes are still possible
For all edges (u,v) in E:
If u in S AND v in T AND f(u,v)<c(u,v):
S = S ∪ {v} # move v from T to S
T = T - {v}
made_change = True
Else If u in T AND v in S AND f(u,v)>0:
S = S ∪ {u} # move u from T to S
T = T - {u}
made_change = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment