Homework 3
|
Vary the probability of mutation and the number of generations for finding a suitably fit individual.
Modify the palindrome problem to find a palindrome of length 6 constructed of digits 0..9. Run several times for different number of generations.
Rates of convergence should be significantly different. Why?
Initial Goal
283 123
164 8 4
7 5 765
The goal should be found at depth 5 after 15 states are generated, including the initial state.
Hint: The initial state is expanded to three other nodes by moving the blank as follows:
Initial
283
164
7 5
Left Up Right
283 283 283
164 1 4 164
75 765 75
The successor function should return all reachable states and could also return h(n) for each state returned.