1 / 15

Evolving Pre-Sort Algorithms

Evolving Pre-Sort Algorithms. Joe Barker. Why Sorting?. Sorting is used everywhere Classical methods for developing new algorithms has been pretty much mined out Genetic Programming (GP) will allow us to find new improvements. Why Pre-Sorting?.

dimaia
Download Presentation

Evolving Pre-Sort Algorithms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Evolving Pre-Sort Algorithms Joe Barker

  2. Why Sorting? • Sorting is used everywhere • Classical methods for developing new algorithms has been pretty much mined out • Genetic Programming (GP) will allow us to find new improvements

  3. Why Pre-Sorting? • When evolving programs, the question of generality arises • How do we know the solution works for all possible inputs? • Solution: Provide a method for graceful failure • GP creates pre-sort algorithms and classic sorts are used to “clean up”

  4. Previously • John Koza did major work on GP • Kenneth Kinnear did some work evolving sort algorithms • No obvious work with pre-sort algorithms

  5. (2) Previously • Kinnear’s work was mostly examining the types(and generality) • Action nodes: • Non-terminal: dobl, if, if-lt • Terminal: order, swap • Expression nodes: • Non-terminal: e-, e1-, e1+, wismaller, wislarger, less • Terminal: *len*, index

  6. (3) Previously • Genetic Operators • Single Crossover • Mutation • Non-Fitness Single Crossover • Hoist • Create

  7. Design - Individual • Actions • Non-Terminals: LOOP, DUAL • Terminals: ORDER,SWAP • Expressions • Non-Terminals: +,-,*,/,%,LARGER,SMALLER • Terminals: SIZE, I(0-3), CONST(0-10)

  8. Design - Fitness • Every individual • All individuals use same input • Individual execution is terminated if the number of operations exceeds a limit • Weighted sum of: • Compares in individual and “cleanup” sort • Swaps • Arithmetic operation executed

  9. (2) Design - Fitness • Input • Array of random size n, 64-1024 • Initially either in-order or reverse-order • c*n random swaps performed

  10. Design - Evolution • Selection: Blocked-rank selection, only mature • Crossover • Make a list of sub-trees of each parent within a [min,max] “expected” depth • Choose a tree uniformly from each list to swap • Mutation • Create a sub-tree with max. depth of tree to be replaced • N-F Crossover, Hoist

  11. Design - Population • Initialization • Random trees • Size of action and expression different • Maturity: >=30 steps • Competition • Elitist (except immature ind.)

  12. Design - Other • No termination • Signal causes program state and summary to be dumped to file • State can be reloaded to continue run

  13. Experiment • Bubble sort (in-order best) • Data distributions • Nearly sorted • Nearly reversed-sorted • Very random

  14. Future Work • Different sorts • Node types to match sorts • Run-time compilation of trees to speed execution

  15. Questions?

More Related