tvwenger / maxfield

An Ingress Linking and Fielding Strategy Generator
http://www.ingress-maxfield.com/
GNU General Public License v3.0
106 stars 56 forks source link

Optimize walking distance #7

Closed mvinni closed 8 years ago

mvinni commented 8 years ago

This is a variation of the pull request #2.

Since improveEdgeOrder is called several times in a loop, I put the new code in a new function, improveEdgeOrderMore, that is only called once on the final plan. This doesn't affect the running time of the program as much, but also may give slightly poorer results (the triangulation chosen with the improveEdgeOrder metric may not be the one giving the best result with improveEdgeOrderMore).

This still seems to make the path much shorter no matter what the triangulation actually is, so no harm there (perhaps the attempts loop could optimize on something else besides the path length again?).