title: Some basic questions regarding genetic algorithm
body: <p>I am reading up on an example of a very general genetic algorithm on this <a href="https://www.civil.iitb.ac.in/tvm/1111_nptel/703_GAs/plain/plain.html#x1-120002.5" rel="nofollow">website</a> and I have some questions.</p>
  
  <ol>
  <li><p>How do I handle negative fitness values ? I am unsure how roulette wheel selection would work if some chromosomes have negative fitness. Do I normalize all fitness values ? Scale it ? Is there a general equation that handles negative fitness?</p></li>
  <li><p>The fitness function to convert a minimization problem to a maximization one is <code>F(x) = 1 / (1 + f(x))</code>. I read somewhere that 1 is there to prevent F(x) from going to infinity. But what if f(x) turns out to be -1 ? So again, how do i prevent f(x) from becoming negative ?</p></li>
  <li><p>What happens if one of the chromosomes generate an infeasible solution ? For a very simple example, <code>max(f(x) = x) where f(x) &lt; 10</code>.
  What if one of the chromosome has a solution of 11 ? Do I reject it, pick the second maximum value and end the iteration ? Or do I reject it and use the remaining chromosomes and continue reproducing ?</p></li>
  </ol>
  
  <p>These are all very very general questions as I have just begun studying genetic algorithms. I hope someone can help me on this or send me a simple example handling all 3 scenarios above.</p>