Edit: I had to specify this question. Originally I wanted to discuss different algorithmic approaches. But now I want to ask specifically how an evolutionary algorithm would have to be designed to solve the problem.
The Problem
It is about creating a timetable for a carpool of employees who start and finish work at different times of the day. The best example of this is probably teachers who have very individualised daily working hours. As simple as this may sound at first glance, the problem can quickly become abnormally complex when you consider:
- Anyone who drives on the way back must also have driven on the way there, otherwise the car for the return journey would be missing.
- On average, all participants should drive approximately the same number of times to be fair.
- Overall, as few drives as possible should be made in order to save costs.
- Cars traveling in the same direction at the same time should be evenly loaded.
- People board at different collection points; some collection points are on the route of people from other collection points (drive-by pick up possible), but not the other way round.
- People can also board at other (nearby) collection points if necessary, but they must get off at exactly the same collection point on the way back on the same day, for example to be able to pick up a bicycle parked there.
- Each person has a different number of free seats in their vehicle and can only take a corresponding number of other people with them.
- ...
The Approaches
Different solutions sound promising at first glance, but all have moderate to serious shortcomings. For example, off the top of my head, I can think of four ways to tackle the problem:
- Naive approach. Implement all of the above constraints manually and imperatively by somehow mapping the individual trips and cars in a data structure and then iteratively filling them with people who fulfill certain properties.
- Brute force approach. I generate more or less random constellations of people and have hundreds of thousands of them generated in order to select the least bad constellation.
- AI. The solution for everything, of course. The problem here is that I don't have nearly enough examples for training an AI.
- Evolutionary algorithm. This is my choice.
As far as I know, an evolutionary algorithm works in the same way as the brute force approach, but in a more targeted way, in that the most successful parts of the generated timetable are combined to create an even better timetable.
The problem here is that the problem is so complex (find an optimal driver, an optimal vehicle crew, create an optimal day of the week, an optimal week and make sure that all people drive with similar frequency, ...) that I cannot imagine how I should represent it with just population, genome and gene. Is there such a thing like a multi-layered evolutionary algorithm? Hoping for your help.
The Question
How can I solve this problem with the help of an evolutionary algorithm? More precisely: How do I map people, vehicles, days of the week to genes, genomes and populations?