Blog

The DayKnight 30day challenge concluded

On the last day of the DayKnight challenge it is time to summ up my success or failure, completeing of goals or failure to do so.

There is now a working algorithm, that produces “Results” every time it is asked for them. Good.

There is now a working fitness function, that relatively quickly finds a working solution, although the details which make the solution usable or acceptable are sometimes avoided. It is however based on luck (massive RNG all the way through the algorithm) to find perfect solutions from time to time and solid ones frequently. Just usually not “perfect”. Passable.

As for the reason for the Mediocre solutions. One has to think, that changing one day in the schedule changes possibly the entire Month. Because the number of shifts between doctors had to be equal or fix set. This was the reason i initially thought a pure random and wait would be possible with todays Hardware. A brute force attack i might say. And Genetic algorithm is sort of a brute force attack on the problem. But in doing it all random, it makes good partial solutions worse and good partial solutions better harder and harder depending on overal quality – reached maximum rating.

So i think, there maybe needs to be some heuristic involved. An algorithm, that would try to repair or mutate a solution to adress all its current issues and repair them. This way we could be getting results maybe faster.

I think i will explore something i feel Chess algorithms do when playing. Given i can rate each solution i probably can give ratings to a down-the-tree digging algorithm. For June for example, there are 2.32e19 possible variants of the solution. That feels too much for an array to hold. But well, i could dig to the end, rate, and start over. Such algorithm would probably take ages to finish coding. And another age to run. Will see.

Leave a Reply

Your email address will not be published. Required fields are marked *