Add fold_by_size.

It does not make performances better. Just worse sometimes.
Add simplified graph coloring.
Add comments.