public static void main(String[] args) {
		final var board = Board.BOARD1;
		final var problem = new SudokuProblem(board);

		// Crossovers like SinglePoint can be used
		var engine = Engine.builder(problem)
			.optimize(Optimize.MINIMUM)
			.alterers(
				new SwapMutator<>(0.05),
				new RowCrossover(0.6)
//				new SinglePointCrossover<>(0.3)
			)
			.selector(new TournamentSelector<>(2))
			.populationSize(300)
			.build();

		final var bestPhenotypes = new ArrayList<Phenotype<IntegerGene, Integer>>();
		final var best = engine.stream()
			.limit(1000)
			.peek(r -> bestPhenotypes.add(r.bestPhenotype()))
			.collect(toBestPhenotype());
		out.println("Issues: " + best.fitness());
		final SudokuGrid grid = problem.decode(best.genotype());
		System.out.println(grid);
	}
Fitness function penalizes issues rows, columns, and issues in sub-boards (3x3).
"Issues" mean repeated numbers.
It is one of the simplest fitness function for sudoku.
jenetics.example/src/main/java/io/jenetics/example/sudoku/SudokuProblem.java