title: solve job scheduling with some restrictions by genetic algorithm
body: <p>I'm a new to genetic algorithm</p>
  
  <p>there are many resources teaching how to implement genetic algorithm</p>
  
  <p>and many examples like using binary number or array as a sequence of gene, doing selection and crossover to get the next generation without showing any restriction on which solution in the next generation is invalid (only a fitness function to tell is that a good solution or not)</p>
  
  <p>in job-scheduling problem, if there are some restriction like, "job2 cant be allocated until job1 is finished", how can I make sure the result after crossover or mutation of the initial random solution will not obey the above restriction?  </p>
  
  <p>for example,  </p>
  
  <p>M1[ |-----job1-----|  | ---- job3 ----|]<br/>
  M2[ |----job4----|  |-------job2------|]<br/>
  M3[ |--job5--||-----job6-----|         ]<br/></p>
  
  <p>here job2 is allocated after job1.</p>
  
  <p>If I want to generate the next generation, how can i guarantee the job2 will be allocated after job1?.</p>