diff -r e67ec65747fa -r faaa54ec4520 lemon/unionfind.h --- a/lemon/unionfind.h Wed Dec 12 13:35:55 2007 +0000 +++ b/lemon/unionfind.h Mon Dec 17 09:54:26 2007 +0000 @@ -692,6 +692,9 @@ int cdx = newClass(); classes[cdx].prev = -1; classes[cdx].next = firstClass; + if (firstClass != -1) { + classes[firstClass].prev = cdx; + } firstClass = cdx; int idx = newItem();