Skip to content

Conversation

@nathanneike
Copy link
Contributor

@nathanneike nathanneike commented Dec 12, 2025

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Performance improvement

Motivation and context / Related issue

Sparse EMD solver was 10-40x slower than dense solver on full matrices due to O(n³) complexity bug in arc iteration. The nextOut() and nextIn() methods in sparse_bipartitegraph.h were performing linear search through arc lists on every call during pivot selection.

How has this been tested (if it applies)

  • Rebuilt C++ extension with changes
  • All existing EMD/LP tests pass (1031 tests)

PR checklist

  • I have read the CONTRIBUTING document.
  • The documentation is up-to-date with the changes I made (check build artifacts).
  • All tests passed, and additional code has been covered with new tests.
  • I have added the PR and Issue fix to the RELEASES.md file.

… columns.

Merge remote-tracking branch 'origin/master' into geomloss_update
- Added position tracking maps (_arc_to_out_pos, _arc_to_in_pos) for O(1) arc lookups
- Modified nextOut() and nextIn() to use position maps instead of linear search
@github-actions github-actions bot added the ot.lp label Dec 12, 2025
@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

❌ Patch coverage is 88.23529% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.07%. Comparing base (9043960) to head (184acd3).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #785      +/-   ##
==========================================
- Coverage   97.07%   97.07%   -0.01%     
==========================================
  Files         107      107              
  Lines       22142    22156      +14     
==========================================
+ Hits        21495    21507      +12     
- Misses        647      649       +2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant