-
Notifications
You must be signed in to change notification settings - Fork 1
Slack-induction string removal crossover #42
Conversation
I'll comment on the implementation later, when that's in place :-) |
@N-Wouda Could you review this? The implementation is working, only the sorting of customers in greedy insert is still unfinished. Please help me improve my cpp 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of small remarks. Ones I haven't mentioned every time:
- Pass references to (preferably
const
) things around. References avoid an expensive copy. - Use
auto
andconst
much more. The default should beauto const
. std::vector::erase
(and erase elsewhere) does not work with an iterator at theend()
of the container. What ifstd::find
returnsend()
? This is a potential problem in multiple places. Do we know for every case that we'll never getend()
?
commandline SISR args
@N-Wouda I removed a lot based on our discussion on Slack. String removals are nice, but a lot of things are not necessary (e.g., sorting clients, blinking, string-split). So I removed most of the SISR procedure, leaving only string removals. I also read a bit more into genetic algorithms, specifically about crossovers. To be honest I think that string removals do not really work for crossover. We don't copy anything from the other parent, which results in offspring that are inefficient: the destroyed and repaired regions in the offspring are subject to long local search procedures as the results showed. This is actually the opposite from what we want to achieve from crossover: we are not utilizing "good parts" from the other parents that are already locally optimal. Based on the above, I don't know if we should merge this. What do you think? We could perhaps still run some benchmarks and analyze statistics. FYI, I don't mind it not being merged, I learned plenty of cpp 😄. |
Closes #20.