use a greedy total path length optimizer to improve path length #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit significantly reduces the length a single agent needs to move in order to complete a maxfield operation. Using the EXAMPLE.csv file, whereas the
masterversion gives paths with lengths like: 33677 m, 25036 m, and 26641 m; this version gives: 13509 m, 11181 m, 13447 m.This is implemented by recording which individual edges should be done before the final edge of each triangle, and greedily re-ordering edges within those limits as long as improvement is happening.
I have tested it quite a bit [*] and believe it works. However, while testing on top of 418afc7 (
master) one should be careful, since that version appears to produce bad results (source portals inside already completed fields) about half of the time with EXAMPLE.csv as the input (if this is not a known issue, I might report it properly).Thoughts?
([*] mostly on top of the version by @tvwenger, where this patch applies as-is)