Jump to content

Talk:Stoer–Wagner algorithm

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by TheZuza777 (talk | contribs) at 04:12, 21 October 2016. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

This article contains two sample implementations. The first one is C++, contains a reference, and appears to work.

I can't get the second one to work. First, I can't tell for sure what language it is. It mostly looks like C, but the code uses C++ reference syntax in one place:

int contract( int &s, int &t )

Even after changing the references to pointers, I couldn't get a sensible answer.

Finally, will memset(bin, false, sizeof(bin)); clear the entire array, or is

   memset(bin, false, sizeof(bool)*maxn);

correct?

Single Phase Explanation

It seems that the MinimumCutPhase is missing a couple of sentences. Nowhere is it said in text how to actually pick s, t in the phase mincut.

"So, in a single phase, a pair of vertices s and t , and a min s-t cut C is determined"