public static void main(String[] args) throws IOException {
		final var tsm = new TravelingSalesman(districtCapitals().subSeq(0, 10));

		final Engine<EnumGene<WayPoint>, Double> engine = Engine.builder(tsm)
			.optimize(Optimize.MINIMUM)
			.alterers(
				new SwapMutator<>(0.15),
				new PartiallyMatchedCrossover<>(0.15))
			.build();

		// Create evolution statistics consumer.
		final EvolutionStatistics<Double, ?>
			statistics = EvolutionStatistics.ofNumber();

		final Phenotype<EnumGene<WayPoint>, Double> best = engine.stream()
			.limit(1_000)
			.peek(statistics)
			.collect(toBestPhenotype());

		final ISeq<WayPoint> path = tsm.decode(best.genotype());

		final GPX gpx = GPX.builder()
			.addTrack(track -> track
				.name("Best Track")
				.addSegment(s -> s.points(path.asList())))
			.build();

		final double km = tsm.fitness(best.genotype())/1_000.0;
		GPX.Writer.of(new Indent("    "))
			.write(gpx, format("%s/out_%d.gpx", getProperty("user.home"), (int)km));

		System.out.println(statistics);
		System.out.println("Length: " + km);
	}
Create a new TSP instance with the way-points we want to visit.

@param points the way-points we want to visit
@throws NullPointerException if the given {@code points} seq is {@code null}
jenetics.example/src/main/java/io/jenetics/example/TravelingSalesman.java