Click here to Skip to main content
15,846,899 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm working on Transport Salesman Problem solution with a Genetic Algorithm.
Some chromosomes are contain the shortest way, but they still aren't appropriate. For example, a salesman must get to the A city at 6.00 pm, but using the solution of a chromosome he'll get there at 7.00 pm. Thus, this solution is not correct.

What should I do with this issue?
Firstly, I can change these chromosomes. But how can I do it?
Secondly, I can keep them. How should I do the selection then?
Thirdly, I can replace them, but I have no idea what should I use instead.

Could you please help me or recommend me some useful information?





English is not my native language, so sorry if I said something wrong.
Posted

1 solution

It is a matter of how you want to handle the various constraints in your GA model. There can be 2 types of constraints:
1. Hard Constraints: Requirements that must be met. You may discard such solutions or repair them by orchestrating a mutation.
2. Soft Constraints: Requirements that can be violated. You may introduce measures to penalize such solutions in the fitness function to make them less favorable for subsequent selections.
Find out more :
1. handling constraints in genetic algorithms[^]
2. Genetic Algorithms Demystified[^]
3. Genetic Algorithms Implementation[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900