Solution for Karger mincut algorithm (slow).
New implementation of mincut, much faster.

The graph representation now holds scalar refs, so it's not necessary to
loop through the entire structure every time.