Skip to main content
. 2011 Nov;18(11):1399–1409. doi: 10.1089/cmb.2011.0191
foreachvertex udo
 Assign u uniformly at random with equal probability to set A or set B
end
whilethere exists at least one unhappy vertexdo
 Choose v at random from the set of unhappy vertices
 flip (v)
end
output bipartition (A, B)