-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add backtracking feature #427
Conversation
Here are the paths that are doubled: It's hard for me to tell if those were good choices. I just have to trust that the algorithm did it right. Definitely we could have made different choices if we didn't use a greedy algorithm but this is a good start. Maybe in the future I can use an algorithm that searches the space of choices, like a minimum weight matching. Code for that is the Blossom V algorithm. |
a18c3e3
to
fcb681b
Compare
backtrack does a greedy search among line segments looking for vertices that have: * odd number of edges * more outbound edges than inbound and bidirectional * more inbound edges than outbound and bidirectional For each one, it finds the nearest other vertex for which duplicating edges would create a euler circuit. Edges are only added if milling them is faster than retracting, moving, and lowering.
7256a93
to
11c837a
Compare
Blossom V requires undirected edges as far as I can tell so it won't suit. As a test, after enabling backtrack for all of the integration tests, I had |
--backtrack
does a greedy search among line segments looking forvertices that have:
For each one, it finds the nearest other vertex for which duplicating
edges would create a euler circuit. Edges are only added if milling
them is faster than retracting, moving, and lowering.