Fixed Solution validation

Previously, the valid flag would remain true while adjacent vertices had the
same color. This would lead to solutions being marked as valid even though
they aren't.