Genetic Algorithm Example based on Koza, J Genetic Programming. Cambridge MA: Basic Books
D Goforth - COSC 4117, fall Avoiding paths altogether genetic algorithms 1.pick set of states randomly 2.order states by fitness 3.create new set of states by combining state variables of most fit 4.make a few random changes to state variables 5.go to 2
D Goforth - COSC 4117, fall Example: Koza, based on Goldberg and Samtani in 1986 Problem minimize cost of 10-member truss that meets stress requirements 100kg 8m 6m A10 A1 A2 A3 A4 A5 A6 A7 A8 A9
D Goforth - COSC 4117, fall Example: Koza, based on Goldberg and Samtani in 1986 Problem minimize cost of 10-member truss that meets stress requirements 100kg 8m 6m A10 A1 A2 A3 A4 A5 A6 A7 A8 A9
D Goforth - COSC 4117, fall Problem definition 16 levels of strength for beams based on cross- section; cost increases with cross-section Stress requirements for the truss Goal: minimize cost of safe truss 100kg 8m 6m A10 A1 A2 A3 A4 A5 A6 A7 A8 A9 Cost is minimized by minimizing truss weight = cross-section * length Stress calculations are based on all member weights (succeed/fail)
D Goforth - COSC 4117, fall Problem representation Represent cross-sections by 4-bit binary code Represent a particular design by 10x4=40 bits E.g., A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 State space is set of all possible designs 2 40 designs No obvious start state; no “path” to solution Genetic algorithm
D Goforth - COSC 4117, fall Genetic Algorithm I 1.pick set of states randomly (initial population) (351) (377) (391) (438) (fail) (fail) 2.order states by fitness (weight, stress)
D Goforth - COSC 4117, fall Genetic Algorithm II 3.create new set of states by combining state variables of (3) most fit and replacing least fit (337) (351) (366) (370) (377) (391) 4.make a few mutations (random changes to variables) 5.go to 2 repeat until no more improvement in best fitness