Repository navigation
Conversation
Augmenting paths between two trees run first. If they take more than 16 orphans and path steps per face, or more than 500 per augmentation, highest-label push-relabel with global relabeling and gap heuristic continues from the same flow, releasing sink capacity in 16 stages. 4.5-15x faster for seeds far apart, the same minimal cut. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The work-per-augmentation rule fired after 0.2 units per face in findOuterLayer on a thick shell of 2M faces, where the trees were about to finish: 2.4x slower than before. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The constructor took 28 ms on 1M faces, now about 20 ms. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Shells in findOuterLayer with thickness 1.5-1.7% of the box diagonal were slower than with trees only, now they are faster. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Push-relabel works on a copy of the residual graph while path augmentation continues in a task, the first to finish gives the result. Shells in findOuterLayer with thickness 1.1-1.3% of the box diagonal were up to 1.46x slower than with trees only, now within 8%. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
An earlier switch was up to 1.5x slower than trees only on shells in findOuterLayer with thickness 1.1-1.3% of the box diagonal, and racing the two methods helped only with a free thread. With the later switch no sampled thickness is slower. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…itch to push-relabel Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
segmentByGraphCutandfillContourLeftByGraphCutreturn the same minimal cut (if it is unique), faster when it is hard to find.Time in ms, 1M faces (dragon), all threads, same faces in the result except one tie noted below. Ryzen 9 with MSVC is min of 3 runs; i7-14700KF with MSVC and Apple M1 Pro with clang 22 are min of 2 alternating runs:
segmentByGraphCut, small far seeds, curvature metricsegmentByGraphCut, seeds are 20% of the mesh at each end, length metricsegmentByGraphCut, seeds 30% of the box apartfillContourLeftByGraphCut, closed contoursThe 10% case on i7 is 14% slower only when it runs after the far-seed cases in one process; started alone it takes 180 ms in master and 179 ms here (min of 4), and at one thread it is equal in both orders.
fillContourLeftByGraphCutwith contours not separating the mesh: the first part of each of 5 loops (3287 edges in total), Ryzen:fillContourLeftByGraphCutwith one closed loop not separating the mesh, torus of 1M faces stretched 2 times along x, Ryzen:The first row is the only measured case with another result: this torus is mirror-symmetric and has two shortest loops around the tube, and master and this PR return different cuts of the same cost. With the symmetry removed (the y > 0 side stretched 1.1 times) the faces are the same again, in 71248 and 943 ms. Loops around the thin handles of the dragon (8-495 edges) take 20-77 ms in both.
Graph cut of
findOuterLayeron a shell of 2M faces made bymakeThickMesh, by thickness in percent of the box diagonal:Up to 1.8% the switch is not reached and the code path is the same as in master. At 2% the switch comes just before the paths would finish: 7% slower on i7, and 4-6% slower at one thread on Ryzen and i7.
Test plan
MRMesh.SegmentByGraphCutLongPathsreaches push-relabel; existing graph cut and contour cut tests pass.Generated with Claude Code