Pseudo Code AddEdge with edge E IF edge E is active THEN RETURN END IF CALL StepForward with edge E RETURNING temporary edge E1 Find the cycle determined by temporary edge E1, A CALL StepForward with the opposite of the edge RETURNING temporary edge E2 Find the cycle determined by temporary edge E2, B IF A == B THEN CALL SplitCycle with edges E1, E2, and cycle A ELSE CALL MergeCycles with edge E1 and cycles A, B END IF
{}