A Very Simple Genetic Algorithm Written in Swift 3

  • > let POP_SIZE = 50

    c'mon everyone knows genetic population is 30

    (I kid I kid but that number has an interesting story https://statswithcats.wordpress.com/2010/07/11/30-samples-st... )

  • > Note -- this is much slower than the python version

    Surprising. Swift, a compiled, static language, is slower than python in this use case?

  • Did not expect to see "cfdrake" when I initially clicked the link - nice port! :)

    Agreed with e28eta - I actually saw RubikSwift demoed at Swift Summit a few days ago as well and enjoyed it. Definitely check it out if you're interested in the topic.

  • I thought this was going to be a link to [1], from a talk given at Swift Summit a couple days ago. I haven't really looked at the code for either one to compare them, but for people who are interested, here's a second simple genetic algorithm in Swift (found in RubikSwift/GeneticsSolver.swift)

    https://github.com/JaviSoto/RubikSwift

  • The other languages are here: https://github.com/jsvazic/GAHelloWorld

  • Are we all just sharing everything we write on here now? Is this notable for some reason?

  • The other languages are here: https://github.com/jsvazic/GAHelloWorld