# GENETIC ALGORITHMS AND GENETIC PROGRAMMING

John R. Koza
Consulting Professor (Medical Informatics) Department of Medicine School of Medicine Consulting Professor Department of Electrical Engineering School of Engineering Stanford University Stanford, California 94305 koza@stanford.edu http://www.smi.stanford.edu/people/koza/

DEFINITION OF THE GENETIC ALGORITHM (GA)
The genetic algorithm is a probabalistic search algorithm that iteratively transforms a set (called a population) of mathematical objects (typically fixed-length binary character strings), each with an associated fitness value, into a new population of offspring objects using the Darwinian principle of natural selection and using operations that are patterned after naturally occurring genetic operations, such as crossover (sexual recombination) and mutation.

GENETIC ALGORITHM (GA)
Generation 0 Individuals 011 001 110 010 Fitness \$3 \$1 \$6 \$2 Generation 1 Offspring 111 010 110 010

HAMBURGER RESTAURANT PROBLEM  Price 1 = \$ 0.50 price 0 = \$10.00 price  Drink 1 = Coca Cola 0 = Wine  Ambiance 1 = Fast snappy service 0 = Leisurely service with tuxedoed waiter .

CHROMOSOME (GENOME) OF THE GLOBAL OPTIMUM McDONALD's 1 1 1 .

Length L=3  Size of search space: KL=2L=23=8 .THE SEARCH SPACE 1 2 3 4 5 6 7 8 000 001 010 011 100 101 110 111  Alphabet size K=2.

even if L is as small as 81.IMPRACTICALITY OF RANDOM OR ENUMERATIVE SEARCH  81-bit problems are very small for GA  However. 281 ~ 1027 = number of nanoseconds since the beginning of the universe 15 billion years ago .

GA FLOWCHART .

GENERATION 0 Generation 0 011 3 001 1 110 6 010 2 1 2 3 4 Total Worst Average Best .

into a new population of offspring objects using the Darwinian principle of natural selection and using operations that are patterned after naturally occurring genetic operations. . each with an associated fitness value. such as crossover (sexual recombination) and mutation.DEFINITION OF THE GENETIC ALGORITHM (GA) The genetic algorithm is a probabalistic search algorithm that iteratively transforms a set (called a population) of mathematical objects (typically fixed-length binary character strings).

PROBABILISTIC SELECTION BASED ON FITNESS      Better individuals are preferred Best is not always picked Worst is not necessarily excluded Nothing is guaranteed Mixture of greedy exploitation and adventurous exploration  Similarities to simulated annealing (SA) .

25 0.08 0.5 .PROBABILISTIC SELECTION BASED ON FITNESS 0.17 0.

17 Total 12 Worst 1 Average 3.DARWINIAN FITNESS PROPORTIONATE SELECTION Generation 0 1 011 3 .25 2 001 1 .50 4 010 2 .00 Best 6 Mating pool 011 3 110 6 110 6 010 2 17 2 4.5 6 .08 3 110 6 .

into a new population of offspring objects using the Darwinian principle of natural selection and using operations that are patterned after naturally occurring genetic operations. .DEFINITION OF THE GENETIC ALGORITHM (GA) The genetic algorithm is a probabalistic search algorithm that iteratively transforms a set (called a population) of mathematical objects (typically fixed-length binary character strings). such as crossover (sexual recombination) and mutation. each with an associated fitness value.

MUTATION OPERATION  Parent chosen probabilistically based on fitness Parent 010  Mutation point chosen at random Parent --0  One offspring Offspring 011 .

5 6 .AFTER MUTATION OPERATION Generation 0 1 011 3 .011 3 17 2 4.00 Best 6 Mating pool Generation 1 011 3 110 6 110 6 010 2 --.25 2 001 1 .17 Total 12 Worst 1 Average 3.50 4 010 2 .08 3 110 6 .

CROSSOVER OPERATION  2 parents chosen probabilistically based on fitness Parent 1 Parent 2 011 110 .

CROSSOVER (CONTINUED)  Interstitial point picked at random Fragment 1 01Fragment 2 11-  2 remainders Remainder 1 Remainder 2 --1 --0  2 offspring produced by crossover Offspring 1 111 Offspring 2 010 .

25 2 001 1 .17 Total 12 Worst 1 Average 3.5 6 .AFTER CROSSOVER OPERATION Generation 0 1 011 3 .00 Best 6 Mating pool Generation 1 011 3 2 111 7 110 6 2 010 2 110 6 010 2 17 2 4.08 3 110 6 .50 4 010 2 .

50 110 6 --.08 3 110 6 .110 6 4 010 2 .25 2 001 1 .17 Total 12 17 Worst 1 2 Average 3.AFTER REPRODUCTION OPERATION Generation 0 Mating pool Generation 1 1 011 3 .5 Best 6 6 .00 4.

into a new population of offspring objects using the Darwinian principle of natural selection and using operations that are patterned after naturally occurring genetic operations. . such as crossover (sexual recombination) and mutation.DEFINITION OF THE GENETIC ALGORITHM (GA) The genetic algorithm is a probabalistic search algorithm that iteratively transforms a set (called a population) of mathematical objects (typically fixed-length binary character strings). each with an associated fitness value.

50 4 010 2 .08 3 110 6 .110 6 --.011 3 18 2 4.5 7 .00 Best 6 Mating pool 011 3 110 6 110 6 010 2 17 2 4.GENERATION 1 Generation 0 1 011 3 .5 6 Generation 1 2 111 7 2 010 2 --.17 Total 12 Worst 1 Average 3.25 2 001 1 .

each with an associated fitness value. such as crossover (sexual recombination) and mutation. into a new population of offspring objects using the Darwinian principle of natural selection and using operations that are patterned after naturally occurring genetic operations.DEFINITION OF THE GENETIC ALGORITHM (GA) The genetic algorithm is a probabalistic search algorithm that iteratively transforms a set (called a population) of mathematical objects (typically fixed-length binary character strings). .

. such as crossover (sexual recombination) and mutation.DEFINITION OF THE GENETIC ALGORITHM (GA) The genetic algorithm is a probabalistic search algorithm that iteratively transforms a set (called a population) of mathematical objects (typically fixed-length binary character strings). into a new population of offspring objects using the Darwinian principle of natural selection and using operations that are patterned after naturally occurring genetic operations. each with an associated fitness value.

there is probabilistic scenario as part of the fitness measure .Best is not always picked .PROBABILISTIC STEPS  The initial population is typically random  Probabilistic selection based on fitness .Worst is not necessarily excluded  Random picking of mutation and crossover points  Often.

ANTENNA DESIGN .

Z1. 0) in the middle of the ground plane  The antenna must fit inside the 0. Y1.« . 0. X2.ANTENNA DESIGN  The problem (Altshuler and Linden 1998) is to determine the x-y-z coordinates of the 3dimensional position of the ends (X1. Y2. Y7. Z2.5P cube . Z7) of 7 straight wires so that the resulting 7-wire antenna satisfies certain performance requirements  The first wire starts at feed point (0. X7.

ANTENNA GENOME X1 Y1 Z1 X2 Y2 Z2 « +0010 -1110 +0001 +0011 -1011 +0011 «  105-bit chromosome (genome)  Each x-y-z coordinate is represented by 5 bits (4-bit granularity for data plus a sign bit)  Total chromosome is 3 v 7 v 5 = 105 bits .

The radiation pattern is simulated by National Electromagnetics Code (NEC) .ANTENNA FITNESS  Antenna is for ground-to-satellite communications for cars and handsets  We desire near-uniform gain pattern 10r above the horizon  Fitness is measured based on the antenna's radiation pattern.

the better .ANTENNA FITNESS  Fitness is sum of the squares of the difference between the average gain and the antenna's gain  Sum is taken for angles 5 between -90r and +90r and all azimuth angles * from 0r to 180r  The smaller the value of fitness.

GRAPH OF ANTENNA FITNESS .

PATENT 5.U.719. S.794 .

10-MEMBER TRUSS .

crosssectional area v length) . and the wall (Goldberg and Samtani 1986)  Truss has 10 members (6 are length of 30 feet and 4 are length 30¥2 = 41 feet)  The problem is to determine the cross-sectional areas (A1. the load.e.10-MEMBER TRUSS  Prespecified topological arrangement of the 10 members.. « . A10) of each of the 10 members so as to minimize weight of the material for a truss that supports the 2 loads  The weight is based on volume (i.

TRUSS GENOME A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 0010 1110 0001 0011 1011 0011 1111 0011 0011 1010      40-bit chromosome (genome) 4-bit granularity for truss diameters 0000 = smallest diameter 1111 = largest diameter Total chromosome is 4 v 10 = 40 bits .

fitness is computed by taking the sum. ± Second. the better .  The smaller the total fitness. of the cross-sectional area of each member times the length of each member (30 feet or 30¥2 = 41 feet).TRUSS FITNESS  Two-part (multiobjective) fitness measure ± First. over the 10 members. Stresses are computed using standard mechanical engineering techniques. a penalty (up to 10%) is imposed for violating the stress constraints.

CELLULAR AUTOMATA .

STATE TRANSITION TABLE # 0 1 2 3 4 « 127 WWW 0 0 0 0 0 « 1 WW 0 0 0 0 0 « 1 W 0 0 0 0 1 « 1 X 0 0 0 0 1 « 1 E 0 0 1 1 0 « 1 EE 0 1 0 1 0 « 1 EEE 1 0 0 0 0 « 1 Rule a0 a1 a2 a3 a4 « a127 .

CELLULAR AUTOMATA A0 a0 A1 a1 A2 a2 « « A127 a127  128-bit chromosome (genome) .

PROBLEM-SPECIFIC GENOMES N v M GENOME 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 0 1 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 1 0 1 1 1 0 .

GENETIC ALGORITHM USING VARIABLE-LENGTH STRINGS  5-WIRE ANTENNA (5 v 15 = 75 bits) X1 Y1 Z1 « « X5 Y5 Z5 +0010 -1110 +0001 +0010 -1110 +0001  4-WIRE ANTENNA (4 v 15 = 60 bits) X1 Y1 Z1 « « X4 Y4 Z4 +1010 -0110 +1101 +1010 -0110 +1001 .

GENETIC PROGRAMMING .

how can computers be made to do what is needed to be done. without being told exactly how to do it?"  Attributed to Arthur Samuel (1959) .THE CHALLENGE "How can computers learn to solve problems without being explicitly programmed? In other words.

. to get machines to exhibit behavior.CRITERION FOR SUCCESS "The aim [is] .. which if done by humans. would be assumed to involve the use of intelligence.³  Arthur Samuel (1983) .

REPRESENTATIONS  Decision trees  If-then production rules  Horn clauses  Neural nets  Bayesian networks  Frames  Propositional logic  Binary decision diagrams  Formal grammars  Coefficients for polynomials  Reinforcement learning tables  Conceptual clusters  Classifier systems .

A COMPUTER PROGRAM .

GENETIC PROGRAMMING (GP)  GP applies the approach of the genetic algorithm to the space of possible computer programs  Computer programs are the lingua franca for expressing the solutions to a wide variety of problems  A wide variety of seemingly different problems from many different fields can be reformulated as a search for a computer program to solve the problem. .

.  Genetic programming is an automated invention machine.  Genetic programming has delivered a progression of qualitatively more substantial results in synchrony with five approximately order-of-magnitude increases in the expenditure of computer time.GP  MAIN POINTS  Genetic programming now routinely delivers high-return human-competitive machine intelligence.

DEFINITION OF ³HIGHRETURN´ The AI ratio (the ³artificial-to-intelligence´ ratio) of a problem-solving method as the ratio of that which is delivered by the automated operation of the artificial method to the amount of intelligence that is supplied by the human applying the method to a particular problem .

DEFINITION OF ³ROUTINE´ A problem solving method is routine if it is general and relatively little human effort is required to get the method to successfully handle new problems within a particular domain and to successfully handle new problems from a different domain. .

or patentable today  Publishable in its own right as a new scientific result independent of the fact that the result was mechanically created  Holds it own in regulated competition against humans (or programs)  5 other similar criteria that are ³arms-length´ from the fields of AI.CRITERIA FOR ³HUMAN-COMPETITIVENESS´  Previously patented. an improvement over a patented invention. ML. GP .

PROGRESSION OF QUALITATIVELY MORE SUBSTANTIAL RESULTS PRODUCED BY GP      Toy problems Human-competitive non-patent results 20th-century patented inventions 21st-century patented inventions Patentable new inventions .

GP FLOWCHART .

else temp1 = 4. return (temp2). temp2.A COMPUTER PROGRAM IN C int foo (int time) { int temp1. } . if (time > 10) temp1 = 3. temp2 = temp1 + 1 + 2.

OUTPUT OF C PROGRAM Time 0 1 2 3 4 5 6 7 8 9 10 11 12 Output 6 6 6 6 6 6 6 6 6 6 6 7 7 .

PROGRAM TREE (+ 1 2 (IF (> TIME 10) 3 4)) .

CREATING RANDOM PROGRAMS .

IFLTE}  Available terminals T = {X. -. *. Y. Random-Constants}  The random programs are: ± Of different sizes and shapes ± Syntactically valid ± Executable .CREATING RANDOM PROGRAMS  Available functions F = {+. %.

GP GENETIC OPERATIONS     Reproduction Mutation Crossover (sexual recombination) Architecture-altering operations .

MUTATION OPERATION .

MUTATION OPERATION Select 1 parent probabilistically based on fitness Pick point from 1 to NUMBER-OF-POINTS Delete subtree at the picked point Grow new subtree at the mutation point in same way as generated trees for initial random population (generation 0)  The result is a syntactically valid executable program  Put the offspring into the next generation of the population     .

CROSSOVER OPERATION .

CROSSOVER OPERATION  Select 2 parents probabilistically based on fitness  Randomly pick a number from 1 to NUMBER-OFPOINTS for 1st parent  Independently randomly pick a number for 2nd parent  The result is a syntactically valid executable program  Put the offspring into the next generation of the population  Identify the subtrees rooted at the two picked points .

REPRODUCTION OPERATION  Select parent probabilistically based on fitness  Copy it (unchanged) into the next generation of the population .

FIVE MAJOR PREPARATORY STEPS FOR GP      Determining the set of terminals Determining the set of functions Determining the fitness measure Determining the parameters for the run Determining the method for designating a result and the criterion for terminating a run .

ILLUSTRATIVE GP RUN .

80 1.80 -0.00 0.56 1.24 1.20 0.44 3.00 .00 1.00 -0.20 0.40 -0.76 0.00 0.96 2.40 0.60 0.SYMBOLIC REGRESSION Independent Dependent variable X variable Y -1.84 0.76 0.60 -0.84 1.00 1.

%} 1 2 3 Terminal set: Function set: Fitness: The sum of the absolute value of the differences between the candidate program¶s output and the given data (computed over numerous values of the independent variable x from ±1.1 4 5 Parameters: Termination: .0 to +1. Random-Constants} F = {+.PREPARATORY STEPS Objective: Find a computer program with one input (independent variable X) whose output equals the given data T = {X. *.0) Population size M = 4 An individual emerges whose sum of absolute errors is less than 0. -.

SYMBOLIC REGRESSION POPULATION OF 4 RANDOMLY CREATED INDIVIDUALS FOR GENERATION 0 .

SYMBOLIC REGRESSION x2 + x + 1 FITNESS OF THE 4 INDIVIDUALS IN GEN 0

x+1 0.67

x2 + 1 1.00

2 1.70

x 2.67

SYMBOLIC REGRESSION x2 + x + 1 GENERATION 1

Mutant of (c) Copy of (a) picking ³2´ as mutation point

First offspring of crossover of (a) and (b) picking ³+´ of parent (a) and left-most ³x´ of parent (b) as crossover points

Second offspring of crossover of (a) and (b) picking ³+´ of parent (a) and left-most ³x´ of parent (b) as crossover points

CLASSIFICATION

GP TABLEAU ± INTERTWINED SPIRALS
Create a program to classify a given point in the x-y plane to the red or blue spiral Terminal set: T = {X,Y,Random-Constants} Function set: F = {+,-,*,%,IFLTE,SIN,COS} The number of correctly classified points (0 ± 194) Parameters: M = 10,000. G = 51 Termination: An individual program scores 194 Fitness: Objective:

1 2 3 4 5

WALL-FOLLOWER .

FITNESS .

BEST OF GENERATION 57 .

BOX MOVER ± BEST OF GEN 0 .

BOX MOVER GEN 45 ± FITNESS CASE 1 .

TRUCK BACKER UPPER .

y angle between trailer and horizontal. 5d  One control variable (steering wheel turn angle)  State transition equations map the 4 state variables into 1 output (the control variable)  Simulation run over many initial conditions and over hundreds of time steps . x vertical position. 5t angle between trailer and cab.TRUCK BACKER UPPER  4-Dimensional control problem ± ± ± ± horizontal position.

GENETIC PROGRAMMING: ON THE PROGRAMMING OF COMPUTERS BY MEANS OF NATURAL SELECTION (Koza 1992) .

adaptive systems.2 MAIN POINTS FROM 1992 BOOK  Virtually all problems in artificial intelligence.  Genetic programming provides a way to successfully conduct the search for a computer program in the space of computer programs. and automated learning can be recast as a search for a computer program. machine learning. .

SOME RESULTS FROM 1992 BOOK           Intertwined Spirals Truck Backer Upper Broom Balancer Wall Follower Box Mover Artificial Ant Differential Games Inverse Kinematics Central Place Foraging Block Stacking         Randomizer Cellular Automata Task Prioritization Image Compression Econometric Equation Optimization Boolean Function Learning Co-Evolution of GamePlaying Strategies .

PROGRESSION OF QUALITATIVELY MORE SUBSTANTIAL RESULTS PRODUCED BY GP      Toy problems Human-competitive non-patent results 20th-century patented inventions 21st-century patented inventions Patentable new inventions .

COMPUTER PROGRAMS  Subroutines provide one way to REUSE code  possibly with different instantiations of the dummy variables (formal parameters)  Loops (and iterations) provide a 2nd way to REUSE code  Recursion provide a 3rd way to REUSE code  Memory provides a 4th way to REUSE the results of executing code .

SYMBOLIC REGRESSION Fitness case L0 1 2 3 4 5 6 7 8 9 10 3 7 10 3 4 3 5 1 2 8 W0 4 10 9 9 3 3 9 2 6 1 H0 7 9 4 5 2 1 9 9 8 10 L1 2 10 8 1 7 9 1 3 2 7 W1 5 3 1 6 6 5 7 9 6 5 H1 3 1 6 4 1 4 6 2 10 1 Dependent variable D 54 600 312 111 -18 -171 363 -36 -24 45 .

EVOLVED SOLUTION (.(* (* W0 L0) H0) (* (* W1 L1) H1)) .

DIFFERENCE IN VOLUMES D = L0W0H0 ± L1W1H1 .

AUTOMATICALLY DEFINED FUNCTION volume .

AUTOMATICALLY DEFINED FUNCTION volume (progn (defun volume (arg0 arg1 arg2) (values (* arg0 (* arg1 arg2)))) (values (.(volume L0 W0 H0) (volume L1 W1 H1)))) .

AUTOMATICALLY DEFINED FUNCTIONS  ADFs provide a way to REUSE code  Code is typically reused with different instantiations of the dummy variables (formal parameters) .

ADDITION OF V0 AND V1 Fitness case L0 1 2 3 4 5 6 7 8 9 10 3 7 10 3 4 3 5 1 2 8 W0 4 10 9 9 3 3 9 2 6 1 H0 7 9 4 5 2 1 9 9 8 10 L1 2 10 8 1 7 9 1 3 2 7 W1 5 3 1 6 6 5 7 9 6 5 H1 3 1 6 4 1 4 6 2 10 1 V0 84 630 360 135 24 9 405 18 96 80 V1 30 30 48 24 42 180 42 54 120 35 D 54 600 312 111 -18 -171 363 -36 -24 45 .

DIVIDE AND CONQUER .

DIVIDE AND CONQUER  Decompose a problem into sub-problems  Solve the sub-problems  Assemble the solutions of the subproblems into a solution for the overall problem .

CHANGE OF REPRESENTATION .

CHANGE OF REPRESENTATION  Identify regularities  Change the representation  Solve the overall problem .

automatically defined function. such as ARG0. ADF)  In generation 0. create random programs with different ingredients for the RPB and the ADF ± Terminal set for ADF typically contains dummy arguments (formal parameters)..e. ARG1.ADF IMPLEMENTATION  Each overall program in population includes ± a main result-producing branch (RPB) and ± function-defining branch (i. « ± Function set of the RPB contains ADF0 ± ADFs are private and associated with a particular individual program in the population .

ADF MUTATION  Select parent probabilistically on the basis of fitness  Pick a mutation point from either RPB or an ADF  Delete sub-tree rooted at the picked point  Grow a new sub-tree at the picked point composed of the allowable ingredients appropriate for the picked point  The offspring is a syntactically valid executable program .

ADF CROSSOVER  Select parent probabilistically on the basis of fitness  Pick a crossover point from either RPB or an ADF of the FIRST patent  The choice of crossover point in the SECOND parent is RESTRICTED to the picked RPB or to the picked ADF  The sub-trees are swapped  The offspring are syntactically valid executable programs .

GENETIC PROGRAMMING II: AUTOMATIC DISCOVERY OF REUSABLE PROGRAMS (Koza 1994) .

adaptive systems. and automated learning  Scalability can be achieved by reuse  Genetic programming provides a way to automatically discover and reuse subprograms in the course of automatically creating computer programs to solve problems .MAIN POINTS OF 1994 BOOK  Scalability is essential for solving non-trivial problems in artificial intelligence. machine learning.

COMPUTER PROGRAMS  Subroutines provide one way to REUSE code  possibly with different instantiations of the dummy variables (formal parameters)  Loops (and iterations) provide a 2nd way to REUSE code  Recursion provide a 3rd way to REUSE code  Memory provides a 4th way to REUSE the results of executing code .

MEMORY Settable (named) Indexed vector Matrix memory Relational memory variables memory .

LANGDON'S DATA STRUCTURES     Stacks Queues Lists Rings .

COMPUTER PROGRAMS  Subroutines provide one way to REUSE code  possibly with different instantiations of the dummy variables (formal parameters)  Loops (and iterations) provide a 2nd way to REUSE code  Recursion provide a 3rd way to REUSE code  Memory provides a 4th way to REUSE the results of executing code .

RPB. fixed set ± protein or DNA sequence (of varying length) ± time-series data ± two-dimensional array of pixels  Memory is usually involved and is used to communicate between IPB. and ADF .AUTOMATICALLY DEFINED ITERATION (ADI)  The overall program includes an iterationperforming branch (IPB) in addition to a result-producing branch (RPB) and functiondefining branches (ADF)  There are no infinite loops because the iteration is performed over a known.

TRANSMEMBRANE SEGMENT IDENTIFICATION PROBLEM

Goal is to classify a given protein segment as being a transmembrane domain or non-transmembrane area of the protein

TRANSMEMBRANE SEGMENT IDENTIFICATION PROBLEM
(progn (defun ADF0 () (ORN (ORN (ORN (I?) (H?)) (ORN (P?) (G?))) (ORN (ORN (ORN (Y?) (N?)) (ORN (T?) (Q?))) (ORN (A?) (H?)))))) (defun ADF1 () (values (ORN (ORN (ORN (A?) (I?)) (ORN (L?) (W?))) (ORN (ORN (T?) (L?)) (ORN (T?) (W?)))))) (defun ADF2 () (values (ORN (ORN (ORN (ORN (ORN (D?) (E?)) (ORN (ORN (ORN (D?) (E?)) (ORN (ORN (T?) (W?)) (ORN (Q?) (D?)))) (ORN (K?) (P?)))) (ORN (K?) (P?))) (ORN (T?) (W?))) (ORN (ORN (E?) (A?)) (ORN (N?) (R?)))))) (progn (loop-over-residues (SETM0 (+ (- (ADF1) (ADF2)) (SETM3 M0)))) (values (% (% M3 M0) (% (% (% (- L -0.53) (* M0 M0)) (+ (% (% M3 M0) (% (+ M0 M3) (% M1 M2))) M2)) (% M3 M0))))))

TRANSMEMBRANE SEGMENT IDENTIFICATION PROBLEM

 in-sample correlation of 0.976  out-of-sample correlation of 0.968  out-of-sample error rate 1.6%

   

loop initialization branch, LIB loop condition branch, LCB loop body branch, LBB loop update branch, LUB

COMPUTER PROGRAMS  Subroutines provide one way to REUSE code  possibly with different instantiations of the dummy variables (formal parameters)  Loops (and iterations) provide a 2nd way to REUSE code  Recursion provide a 3rd way to REUSE code  Memory provides a 4th way to REUSE the results of executing code .

RCB recursion body branch. RGB .AUTOMATICALLY DEFINED RECURSION (ADR)     recursion condition branch. RUB recursion ground branch. RBB recursion update branch.

HUMAN-COMPETITIVE RESULTS (NOT RELATED TO PATENTS) Transmembrane segment identification problem for proteins Motifs for D±E±A±D box family and manganese superoxide dismutase family of proteins Cellular automata rule for Gacs-Kurdyumov-Levin (GKL) problem Quantum algorithm for the Deutsch-Jozsa ³early promise´ problem Quantum algorithm for Grover¶s database search problem Quantum algorithm for the depth-two AND/OR query problem Quantum algorithm for the depth-one OR query problem Protocol for communicating information through a quantum gate Quantum dense coding Soccer-playing program that won its first two games in the 1997 Robo Cup competition Soccer-playing program that ranked in the middle of field in 1998 Robo Cup competition Antenna designed by NASA for use on spacecraft Sallen-Key filter .

PROGRESSION OF QUALITATIVELY MORE SUBSTANTIAL RESULTS PRODUCED BY GP      Toy problems Human-competitive non-patent results 20th-century patented inventions 21st-century patented inventions Patentable new inventions .

GENETIC PROGRAMMING III: DARWINIAN INVENTION AND PROBLEM SOLVING (Koza. Andre. Bennett. Keane 1999) .

SUBROUTINE DUPLICATION .

SUBROUTINE CREATION .

SUBROUTINE DELETION .

ARGUMENT DUPLICATION .

ARGUMENT DELETION .

and recursions  Self-organization of hierarchies  Automatic determination of program architecture  Wide range of programming constructs  Well-defined  Problem-independent  Wide applicability  Scalable  Competitive with humanproduced results .16 ATTRIBUTES OF A SYSTEM FOR AUTOMATICALLY CREATING COMPUTER PROGRAMS  Starts with "What needs to be done"  Tells us "How to do it"  Produces a computer program  Automatic determination of program size  Code reuse  Parameterized reuse  Internal storage  Iterations. loops.

GENETIC PROGRAMMING PROBLEM SOLVER (GPPS) .

AUTOMATIC SYNTHESIS OF BOTH THE TOPOLOGY AND SIZING OF ANALOG ELECTRICAL CIRCUITS BY MEANS OF DEVELOPMENTAL GENETIC PROGRAMMING .

a capacitor). . the type of each component (e. and a netlist specifying where each lead of each component is to be connected.g..  Sizing involves specifying the values (typically numerical) of each of the circuit's components.AUTOMATED CIRCUIT SYNTHESIS  The topology of a circuit includes specifying the gross number of components in the circuit.

COMPONENT-CREATING FUNCTIONS      Resistor R function Capacitor C function Inductor L function Diode D function Transistor Q function (3-leaded) .

COMPONENT-CREATING FUNCTIONS .

TOPOLOGY-MODIFYING FUNCTIONS  SERIES division  PARALLEL division  VIA  FLIP .

TOPOLOGY-MODIFYING FUNCTIONS .

DEVELOPMENT-CONTROLLING FUNCTIONS  END function  NOP (No Operation) function  SAFE_CUT function .

THE INITIAL CIRCUIT .

123 end)))) (flip (nop (L -0.277 end) end) (L (± 0.640 0.113) 0.657 end))))) .963 (± (± -0.DEVELOPMENTAL GP (LIST (C (± 0.749) (L -0.880)) (series (flip end) (series (flip end) (L -0.875 -0.

113) 0.875 -0.CAPACITOR-CREATING FUNCTION (LIST (C (± 0.640 0.963 (± (± -0.277 end) end) (L (± -0.657 end))))) .749) (L -0.123 end)))) (flip (nop (L -0.880)) (series (flip end) (series (flip end) (L ± 0.

CAPACITOR-CREATING FUNCTION .

123 end)))) (flip (nop (L -0.963 (± (± -0.640 0.875 -0.SERIES DIVISION FUNCTION (LIST (C (± 0.880)) (series (flip end) (series (flip end) (L ± 0.749) (L -0.277 end) end) (L (± -0.113) 0.657 end))))) .

SERIES DIVISION .

DEVELOPMENTAL GP .

EVALUATION OF FITNESS IN z0 OUT mbryonic ircuit Program Tree ully esigned ircuit (Net raph) ircuit Netlist (ascii) ircuit imulator ( PI ) ircuit ehavior (Output) itness .

DESIRED BEHAVIOR OF A LOWPASS FILTER .

113 George Campbell American Telephone and Telegraph 1917 .EVOLVED CAMPBELL FILTER U.227. S. patent 1.

964 Otto Zobel American Telephone and Telegraph Company 1925 .538.EVOLVED ZOBEL FILTER U. S. patent 1.

EVOLVED SALLEN-KEY FILTER .

663. S.806 Sidney Darlington Bell Telephone Laboratories 1953 . patent 2.EVOLVED DARLINGTON EMITTERFOLLOWER SECTION U.

NEGATIVE FEEDBACK .

HAROLD BLACK¶S RIDE ON THE LACKAWANNA FERRY

Courtesy of Lucent Technologies

20th-CENTURY PATENTS
Campbell ladder topology for filters Zobel ³M-derived half section´ and ³constant K´ filter sections Crossover filter Negative feedback Cauer (elliptic) topology for filters PID and PID-D2 controllers Darlington emitter-follower section and voltage gain stage Sorting network for seven items using only 16 steps 60 and 96 decibel amplifiers Analog computational circuits Real-time analog circuit for time-optimal robot control Electronic thermometer Voltage reference circuit Philbrick circuit NAND circuit Simultaneous synthesis of topology, sizing, placement, and routing

PROGRESSION OF QUALITATIVELY MORE SUBSTANTIAL RESULTS PRODUCED BY GP

    

Toy problems Human-competitive non-patent results 20th-century patented inventions 21st-century patented inventions Patentable new inventions

SIX POST-2000 PATENTED INVENTIONS

EVOLVED HIGH CURRENT LOAD CIRCUIT .

REGISTER-CONTROLLED CAPACITOR CIRCUIT .

LOW-VOLTAGE CUBIC CIRCUIT .

VOLTAGE-CURRENT-CONVERSION CIRCUIT .

LOW-VOLTAGE BALUN CIRCUIT

TUNABLE INTEGRATED ACTIVE FILTER

21st-CENTURY PATENTED INVENTIONS

Low-voltage balun circuit Mixed analog-digital variable capacitor circuit High-current load circuit Voltage-current conversion circuit Cubic function generator Tunable integrated active filter

PROGRESSION OF QUALITATIVELY MORE SUBSTANTIAL RESULTS PRODUCED BY GP

    

Toy problems Human-competitive non-patent results 20th-century patented inventions 21st-century patented inventions Patentable new inventions

NOVELTY-DRIVEN EVOLUTION  Two factors in fitness measure ± Circuit¶s behavior in the frequency domain ± Largest number of nodes and edges (circuit components) of a subgraph of the given circuit that is isomorphic to a subgraph of a template representing the prior art. Graph isomorphism algorithm with the cost function being based on the number of shared nodes and edges (instead of just the number of nodes). .

fitness is the number of shared nodes and edges divided by 10.000. the fitness of a circuit is the product of the two factors.  For circuits scoring 101 hits (100%compliant individuals).NOVELTY-DRIVEN EVOLUTION  For circuits not scoring the maximum number of hits (101). .

PRIOR ART TEMPLATE .

1 .NON-INFRINGING SOLUTION NO.

5 .NON-INFRINGING SOLUTION NO.

GP AS AN INVENTION MACHINE .

CIRCUIT-CONSTRUCTING PROGRAM TREE WITH ADFs .

AUTOMATIC SYNTHESIS OF CIRCUIT LAYOUT INCLUDING THE PLACEMENT OF COMPONENTS AND ROUTING OF WIRES ALONG WITH THE TOPOLOGY AND SIZING .

 Routing involves the assignment of a particular physical location to the wires between the leads of the circuit's components. .CIRCUIT LAYOUT  Circuit placement involves the assignment of each of the circuit's components to a particular physical location on a printed circuit board or silicon wafer.

LAYOUT .

LAYOUT ² GENERATION 0 .

2 .100%-COMPLIANT LOWPASS FILTER GENERATION 25 WITH 5 CAPACITORS AND 11 INDUCTORS  AREA OF 1775.

3 .100%-COMPLIANT LOWPASS FILTER GENERATION 30 WITH 10 INDUCTORS AND 5 CAPACITORS  AREA OF 950.

100%-COMPLIANT LOWPASS FILTER BEST-OF-RUN CIRCUIT OF GENERATION 138 WITH 4 INDUCTORS AND 4 CAPACITORS  AREA OF 359.4 .

LAYOUT  60 DB AMPLIFIER .

AUTOMATIC SYNTHESIS OF BOTH THE TOPOLOGY AND TUNING OF CONTROLLERS .

PROGRAM TREE FOR A CONTROLLER .

CONTROLLER BLOCKS        gain integrator differentiator adder subtractor multiplier differential input integrators  inverter         lead lag two-parameter lag absolute value limiter divider delay conditional operators (switches) .

CONTROLLER_OUTPUT.TERMINAL SET FOR CONTROLLER SYNTHESIS T = { REFERENCE_SIGNAL. PLANT_OUTPUT} .

CONSTRAINED SYNTACTIC STRUCTURE  A grammar that specifies what functions and terminals are allowed as arguments to particular functions  For example. the first argument of the GAIN function must be a value-setting subtree whereas the second can be from the general pool of functions  Also known as strong typing .

0 642 Plant Output Lag 630 636 Lag 640 680 624 -40.0 632 +1.0 622 Control Variable 610 620 626 +1.0 .TWO-LAG PLANT Plant 600 +40.

0). ± 2 different values of the plant's time constant X (0. ± 2 different values for the height of the reference signal (rising from 0 to 1 volts or from 0 to 1 microvolts at t = 100 milliseconds .0).5 and 1.0 and 2.8 FITNESS CASES  8 elements of the fitness represent 2 v 2 v 2 choices: measure ± 2 different values of the plant's internal gain. K (1.

± Additional weighting function.0.FITNESS MEASURE  For each of these 8 fitness cases. a transient analysis (time domain) is performed using the SPICE simulator. . A weights all variations up to 2% above the reference signal by 1. A.  The contribution to fitness for the 8 elements is ± Integral of time-weighted absolute error (ITAE) ± e(t) is difference between plant output and reference signal. but bigger variations by 10. ± Multiplication by B (106 or 1) makes both reference signals equally influential.0. heavily penalizes non-compliant amounts of overshoot.

EVOLVED CONTROLLER FOR TWO-LAG PLANT .

LESS ITAE AND OVERSHOOT .

BETTER DISTURBANCE REJECTION .

REVERSE ENGINEERING OF METABOLIC PATHWAYS .

EVOLVED PATHWAY .

125) (LANDMARK (REPEAT 2 (PROGN2 (DRAW 1.5 NO-WIRE))) (TRANSLATE-RIGHT 0.0 HALF-MM-WIRE) (DRAW 0.125 0.75)) .ANTENNA SYNTHESIS USING GP (PROGN3 (TURN-RIGHT 0.

USING A TURTLE TO DRAW TWODIMENSIONAL ANTENNA .

BEST-OF-RUN ANTENNA FROM GENERATION 90 .

3-DIMENSIONAL ANTENNA .

NASA EVOLVED ANTENNA To be on satellite to be launched in 2004 .

OTHER STRUCTURES .

GENETIC NETWORK FOR lac operon .

EVOLVED NETWORK (IF (< LACTOSE_LEVEL 9.491 ) 2.769 ) 2.97 ) ) (IF (< CAP_LEVEL 1.933 ) (IF (> GLUCOSE_LEVEL 2.982 ) ) ) .511 ) (IF (> CAP_LEVEL 7.208 ) 9.139 ) (IF (< REPRESSOR_LEVEL 6.270 ) (IF (> GLUCOSE_LEVEL 5.0 ) (IF (> REPRESSOR_LEVEL 4.323 (IF (> CAP_LEVEL 1.965 ) ) 0.270 ) 2.639 ) 2.022 9.109 ) 1.586 (IF (> LACTOSE_LEVEL 2.256 ) (IF (> LACTOSE_LEVEL 1.183 ) 6.858 ) (IF (> LACTOSE_LEVEL 2.114 ) 1.978 2.382 ) (IF (> LACTOSE_LEVEL 1.842 ) ) 10.033 (IF (< CAP_LEVEL 4.02 (IF (< CAP_LEVEL 0.807 ) 5.0 ) (IF (> GLUCOSE_LEVEL 6.015 ) 0.0 (IF (< REPRESSOR_LEVEL 4.0 5.022 (IF (< GLUCOSE_LEVEL 2.665 ) 1.842 ) 0.268 ) 2.128 ) 10.713 0.137 ) ) 0.036 (IF (< GLUCOSE_LEVEL 5.022 ) (IF (< GLUCOSE_LEVEL 5.122 ) ) ) ) ) ) (IF (> CAP_LEVEL 0.

} } } .IN C-STYLE PSEUDO CODE if(LACTOSE_LEVEL < 9.022.769) { LAC_mRNA_LEVEL = 2.139) { if(REPRESSOR_LEVEL < 6.0.382) { LAC_mRNA_LEVEL = 10. } } else { if(CAP_LEVEL < 1. } else { LAC_mRNA_LEVEL = 1.982.0.270) { LAC_mRNA_LEVEL = 2. } else { if(GLUCOSE_LEVEL < 2.022. } else { LAC_mRNA_LEVEL = 0.

PARAMETERIZED TOPOLOGIES  One of the most important characteristics of computer programs is that they ordinarily contain inputs (free variables) and conditional operations .

PARAMETERIZED TOPOLOGY FOR LOWPASS FILTER .

PARAMETERIZED TOPOLOGY FOR HIGHPASS FILTER .

PARAMETERIZED TOPOLOGY FOR GENERAL-PURPOSE CONTROLLER .

EVOLVED EQUATIONS FOR GENERALPURPOSE CONTROLLER .

EVOLVED EQUATIONS FOR GENERALPURPOSE CONTROLLER .

PATENTABLE NEW INVENTIONS PID tuning rules that outperform the Ziegler-Nichols and Åström-Hägglund tuning rules General-purpose controllers outperforming Ziegler-Nichols and Åström-Hägglund rules .

PROGRESSION OF QUALITATIVELY MORE SUBSTANTIAL RESULTS PRODUCED BY GP      Toy problems Human-competitive non-patent results 20th-century patented inventions 21st-century patented inventions Patentable new inventions .

PARALLELIZATION WITH SEMI-ISOLATED SUBPOPULATIONS CONTROL PARAMETER FILE KEYBOARD BOSS (Tram) MESH NODE MESH NODE MESH NODE HOST (Pentium PC) DEBUGGER (optional) MESH NODE MESH NODE MESH NODE OUTPUT FILE VIDEO DISPLAY MESH NODE MESH NODE MESH NODE .

Including the Oink  Keep on Trucking  It Takes a Licking and Keeps on Ticking  The Whole is Greater than the Sum of the Parts .GP PARALLELIZATION  Like Hormel. Get Everything Out of the Pig.

PETA-OPS  Human brain operates at 1012 neurons operating at 103 per second = 1015 ops per second  1015 ops = 1 peta-op = 1 bs (brain second) .

EVOLVABLE HARDWARE CORNER OF XILINX XC6216 .

FUNCTION UNIT FOR CELL OF XILINIX XC6216 .

SORTING NETWORK A B C D H G F E .

EVOLVED SORTING NETWORK .

000 12 2 12 2 .000 Pentium II¶s 4-week runs on 1.000 Pentium II¶s 1995±2000 1999±2001 2000±2002 2002-2003 204 1.481 13.900 130.GP 1987±2002 System Dates Speed-up over first system 1 (base) 9 HumanProblem Category competitive results 0 2 toy problems human-competitive results not related to patented inventions 20th-century patented inventions 20th-century patented inventions 21st-century patented inventions patentable new inventions Serial LISP 64 transputers 1987±1994 1994±1997 64 PowerPC¶s 70 Alpha¶s 1.

PROMISING GP APPLICATION AREAS  Problem areas involving many variables that are interrelated in highly non-linear ways  Inter-relationship of variables is not well understood  Discovery of the size and shape of the solution is a major part of the problem  "Black art" problems .

but where you know what you want .PROMISING GP APPLICATION AREAS (CONTINUED)  Areas where you simply have no idea how to program a solution.

PROMISING GP APPLICATION AREAS (CONTINUED)  Problem areas where a good approximate solution is satisfactory y design y control y bioinformatics y classification y data mining y system identification y forecasting .

microarray data y satellite image data y astronomical data y petroleum databases y financial databases y medical records y marketing databases .PROMISING GP APPLICATION AREAS (CONTINUED) y Areas where large computerized databases are accumulating and computerized techniques are needed to analyze the data y genome. protein.

PROMISING GP APPLICATION AREAS (CONTINUED) y Areas for which humans find it very difficult to write good programs y parallel computers y cellular automata y multi-agent strategies y field-programmable game arrays y digital signal processors y swarm intelligence .

(3) discovering the number of substructures. loops. (6) discovering the type of substructures (e. (8) maintaining syntactic validity and locality by means of a developmental process. iterations. (2) reusing substructures. recursions. (5) passing parameters to a substructure. or storage). or (9) discovering a general solution in the form of a parameterized topology containing free variables . subroutines. (4) discovering the nature of the hierarchical references among substructures. (7) discovering the number of arguments possessed by a substructure.g.CHARACTERISTICS SUGGESTING USE OF GP (1) discovering the size and shape of the solution..

DESIGNING A GIRAFFE       Long neck Long tongue Vegetable-digesting enzymes in stomach 4 legs Long legs Brown coloration .

11 feet Floating point Tongue length Carnivorous? Number Leg of legs length 4 Integer Coloration 14 inches No Floating point Boolean 9.THE DESIGN OF A GOOD GIRAFE Neck length 15.96 feet Brown Floating Categorical point .

some gene values found in a giraffe. maximizing any one variable will not lead to the global optimum solution . such as the long neck contribute (alone) negatively to fitness ± requires considerable material to construct ± requires considerable energy to maintain ± prone to injury (thereby hurting rate of survival and reproduction)  Thus.NON-LINEARITY ² GIRAFE  Taken one-by-one.

NON-LINEARITY (CONTINUED)  When the variables are taken in pairs (there are 15 possible pairs). many combinations of pairs (e.g.. Long neck and long tongue) are doubly detrimental .

when taken together. certain combinations of traits. having high escape velocity when faced with predators.NON-LINEARITY (CONTINUED)  But. are "co-adapted sets of alleles" that yield a very fit animal for eating high acacia leaves in the jungle environment. having good camouflage. and exploiting a niche (and avoiding competition) with other animals feeding on low-hanging vegetation .

SEARCH METHODS IN GENERAL      Initial structure(s) Fitness measure Operations for creating new structures Parameters Termination criterion and method of designating the result .

SPACE WITH MANY LOCAL OPTIMA .

they are prone to becoming trapped on local optima  The previous point is especially true for nontrivial search spaces . however.SEARCH METHODS  Blind random search does not use acquired information in deciding on the future direction of the search  Hill combing and gradient descent use acquired information.

7 DIFFERENCES BETWEEN GP AND ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING APPROACHES .

REPRESENTATION Genetic programming overtly conducts it search for a solution to the given problem in program space .

ROLE OF POINT-TO-POINT TRANSFORMATIONS IN THE SEARCH Genetic programming does not conduct its search by transforming a single point in the search space into another single point. but instead transforms a set of points into another set of points .

ROLE OF HILL CLIMBING IN THE SEARCH Genetic programming does not rely exclusively on greedy hill climbing to conduct its search. to choices that are known to be inferior . in a principled way. but instead allocates a certain number of trials.

DETERMINISM IN THE SEARCH Genetic programming conducts its search probabilistically .

ROLE OF AN EXPLICIT KNOWLEDGE BASE Genetic programming does NOT make use of a knowledge base .

.ROLE OF FORMAL LOGIC IN THE SEARCH Genetic programming does not utilize formal logic in it¶s search strategy. Contradictory alternatives are created and actively maintained.

UNDERPINNINGS OF THE TECHNIQUE Biologically inspired .

. ³ ..TURING (1948) Turing made the connection between searches and the challenge of getting a computer to solve a problem without explicitly programming it in his 1948 essay ³Intelligent Machines´ "Further research into intelligence of machinery will probably be very greatly concerned with 'searches' .

TURING¶S 3 APPROACHES TO MACHINE INTELLIGENCE (1948) LOGIC-BASED SEARCH One approach that Turing identified is a search through the space of integers representing candidate computer programs. .

.TURING¶S 3 APPROACHES (CONTINUED) CULTURAL SEARCH A second approach is the "cultural search³ which relies on knowledge and expertise acquired over a period of years from others (akin to present-day knowledgebased systems).

³ .TURING¶S 3 APPROACHES (CONTINUED) GENETICAL OR EVOLUTIONARY SEARCH "There is the genetical or evolutionary search by which a combination of genes is looked for. the criterion being the survival value.

by the identifications´ . There is an obvious connection between this process and evolution. One can then try another and see if it is better or worse.TURING (1950) From Turing¶s 1950 paper "Computing Machinery and Intelligence" « ³We cannot expect to find a good childmachine at the first attempt. One must experiment with teaching one such machine and see how well it learns.

TURING (1950) (CONTINUED) ³Structure of the child machine = Hereditary material ³Changes of the child machine = Mutations ³Natural selection = Judgment of the experimenter´ .