title: EvoPathfinding - Stuck in local optimal
body: <p>I am using a Genetic Algorithm framework to solve a path-finding problem. Specifically, given the following 32x32 maze:</p>
  <pre><code>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  X                      |         X
  X                      |         X
  X                      |         X
  X                      |     G   X
  X                      |         X
  X                      |         X
  X                      |         X
  X                      |         X
  X                      |         X
  X        |             |         X
  X        |             |         X
  X        |             |         X
  X        |             |         X
  X        |             |         X
  X        |             |         X
  X        |             |         X
  X        |             |         X
  X        |             |         X
  X        |             |         X
  X        |             |         X
  X        |             |         X
  X        |             |         X
  X        |             |         X
  X        |                       X
  X        |                       X
  X        |                       X
  X    S   |                       X
  X        |                       X
  X        |                       X
  X        |                       X
  X        |                       X
  X        |                       X
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  </code></pre>
  <p>I wish to reach point <strong>G</strong> by starting from point <strong>S</strong>. The fitness function that I am using here is based on the <em>manhattan distance</em> and for every individual, it goes as follows:</p>
  <ul>
  <li>if the individual crashes on a wall ('|') or an outer bound ('X') his fitness is 0  if</li>
  <li>if the individual final coordinates match point <strong>G</strong> his fitness is 100</li>
  <li>in any other case his fitness is <code>100 - manhattan_distance_from(G)</code></li>
  </ul>
  <p>The problem is, that the evolution process is halted after a maximum number of steady-state generations i.e., the fitness of the generated individuals is saturated and cannot improve further.</p>
  <p>The best final solutions that are refined via the evolution process are like the one below:</p>
  <h3>Best Solution</h3>
  <pre><code>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  X                      |         X
  X                      |         X
  X                      |         X
  X                      |    G    X
  X    ******************|         X
  X    *                 |         X
  X    *                 |         X
  X    *                 |         X
  X    *                 |         X
  X    *   |             |         X
  X    *   |             |         X
  X    *   |             |         X
  X    *   |             |         X
  X    *   |             |         X
  X    *   |             |         X
  X    *   |             |         X
  X    *   |             |         X
  X    *   |             |         X
  X    *   |             |         X
  X    *   |             |         X
  X    *   |             |         X
  X    *   |             |         X
  X    *   |             |         X
  X    *   |                       X
  X    *   |                       X
  X    *   |                       X
  X    S   |                       X
  X        |                       X
  X        |                       X
  X        |                       X
  X        |                       X
  X        |                       X
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  </code></pre>
  <p>This is to be expected though from the standpoint of my fitness function. Because in order to overcome the wall, the algorithm has to generate and maintain individuals by worsening their fitness values since the path has to go down and so the fitness value must get worse.</p>
  <p>While I have tried to increase the impact of the mutation operators in order to generate and maintain diverse populations in my generations I did not manage to overcome the problem of this local optimal and so I am thinking of ways to improve my fitness function.</p>
  <p>Are there any suggestions?</p>