@Override
  public void improveSolution(Board board) {
    // handle black cells
    outer: while (board.getCount(CellColor.BLACK) < board.getSolutionBlackCount()) {
      for (final Set<Cell> group : board.getGroups(CellColor.BLACK)) {
        if (tryExpand(board, group, CellColor.BLACK)) {
          // we need to start from the beginning because the black groups could have changed
          continue outer;
        }
      }
      break;
    }

    // handle white cells
    outer: while (true) {
      board.connectWhiteCells();
      for (final Set<Cell> group : board.getGroups(CellColor.WHITE)) {
        final FixedCell fixedCell = group.iterator().next().getFixedCell();
        if (fixedCell == null || fixedCell.getNumber() > group.size()) {
          if (tryExpand(board, group, CellColor.WHITE)) {
            // we need to start from the beginning because the white groups could have changed
            continue outer;
          }
        }
      }
      break;
    }
  }