code: private Result compareRowwise(Permutation perm) {
          int m = perm.size();
          for (int i = 0; i < m - 1; i++) {
              for (int j = i + 1; j < m; j++) {
                  int x = getConnectivity(best.get(i), best.get(j));
                  int y = getConnectivity(perm.get(i), perm.get(j));
                  if (x > y) return Result.WORSE;
                  if (x < y) return Result.BETTER;
              }
          }
          return Result.EQUAL;
      }
docs: Check a permutation to see if it is better, equal, or worse than the
  current best.
  
  @param perm the permutation to check
  @return BETTER, EQUAL, or WORSE