Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Slack-induction string removal crossover #42

Merged
merged 70 commits into from
Aug 9, 2022
Merged

Slack-induction string removal crossover #42

merged 70 commits into from
Aug 9, 2022

Conversation

leonlan
Copy link
Collaborator

@leonlan leonlan commented Aug 3, 2022

Closes #20.

hgs_vrptw/include/Config.h Outdated Show resolved Hide resolved
hgs_vrptw/src/bindings.cpp Outdated Show resolved Hide resolved
@N-Wouda
Copy link
Owner

N-Wouda commented Aug 3, 2022

I'll comment on the implementation later, when that's in place :-)

@leonlan leonlan self-assigned this Aug 4, 2022
@leonlan
Copy link
Collaborator Author

leonlan commented Aug 4, 2022

@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 😄

Copy link
Owner

@N-Wouda N-Wouda left a 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 and const much more. The default should be auto const.
  • std::vector::erase (and erase elsewhere) does not work with an iterator at the end() of the container. What if std::find returns end()? This is a potential problem in multiple places. Do we know for every case that we'll never get end()?

hgs_vrptw/include/CommandLine.h Outdated Show resolved Hide resolved
hgs_vrptw/include/Config.h Outdated Show resolved Hide resolved
hgs_vrptw/include/crossover.h Outdated Show resolved Hide resolved
benchmark.py Outdated Show resolved Hide resolved
benchmark.py Outdated Show resolved Hide resolved
hgs_vrptw/src/crossover/stringRemovalExchange.cpp Outdated Show resolved Hide resolved
hgs_vrptw/src/crossover/stringRemovalExchange.cpp Outdated Show resolved Hide resolved
hgs_vrptw/src/crossover/stringRemovalExchange.cpp Outdated Show resolved Hide resolved
sisr.py Outdated Show resolved Hide resolved
hgs_vrptw/src/crossover/stringRemovalExchange.cpp Outdated Show resolved Hide resolved
hgs_vrptw/src/bindings.cpp Outdated Show resolved Hide resolved
hgs_vrptw/src/crossover.cpp Outdated Show resolved Hide resolved
hgs_vrptw/src/crossover/selectiveRouteExchange.cpp Outdated Show resolved Hide resolved
hgs_vrptw/src/crossover/selectiveRouteExchange.cpp Outdated Show resolved Hide resolved
hgs_vrptw/src/crossover/stringRemovalExchange.cpp Outdated Show resolved Hide resolved
hgs_vrptw/src/crossover/stringRemovalExchange.cpp Outdated Show resolved Hide resolved
hgs_vrptw/src/crossover.cpp Outdated Show resolved Hide resolved
hgs_vrptw/include/Config.h Outdated Show resolved Hide resolved
hgs_vrptw/include/Config.h Outdated Show resolved Hide resolved
hgs_vrptw/src/crossover/stringRemovalExchange.cpp Outdated Show resolved Hide resolved
@leonlan
Copy link
Collaborator Author

leonlan commented Aug 8, 2022

@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 😄.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slack-induced string removal operator
2 participants