Skip to content

HV3D+ preprocessing: Fix bug related to repeated coordinates#41

Merged
MLopez-Ibanez merged 4 commits intomainfrom
hv3d+-bugfix
Nov 29, 2025
Merged

HV3D+ preprocessing: Fix bug related to repeated coordinates#41
MLopez-Ibanez merged 4 commits intomainfrom
hv3d+-bugfix

Conversation

@apguerreiro
Copy link
Copy Markdown
Collaborator

This pull request fixes a bug in the preprocessing procedure of HV3D+ related to repeated coordinates. A testcase for this bug is:

0.5 0.5 0.1
0.4 0.5 0.2
0.3 0.5 0.3
0.2 0.5 0.4
0.1 0.1 0.5

Although the bug should not lead to incorrect results when using HV3D+, the data structure is not setup as intended. A side effect is that the preprocessing may take longer because the AVL tree may (unnecessarily) keep many points that are weakly dominated in the (x,y)-plane. To check this, we can use a testcase with $n$ points generated like this:

$p^i = (\frac{i-1}{n}, 0.5, 1-\frac{i-1}{n})$ for all $i=1,...,n$.

For large $n$, it is possible to see that the previous version of the code would take longer.

…inates.

* hv_priv.h (compute_area_simple): Change assertions.
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 29, 2025

Codecov Report

❌ Patch coverage is 44.44444% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.49%. Comparing base (2c66c8a) to head (589b9ae).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #41      +/-   ##
==========================================
+ Coverage   73.39%   73.49%   +0.10%     
==========================================
  Files          58       58              
  Lines        5041     5049       +8     
  Branches      964      970       +6     
==========================================
+ Hits         3700     3711      +11     
+ Misses        964      961       -3     
  Partials      377      377              
Flag Coverage Δ
R 78.68% <ø> (ø)
python 72.60% <44.44%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
tests 100.00% <ø> (ø)
src 86.99% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MLopez-Ibanez
Copy link
Copy Markdown
Contributor

Thank you!

Rather than removing the assertion, I have relaxed it to accept area == 0 (but not area < 0).

I have also added the testcase to the testsuite (with all permutations of the columns): multi-objective/testsuite@5b3fa6d

@MLopez-Ibanez MLopez-Ibanez merged commit 0bdd419 into main Nov 29, 2025
37 of 38 checks passed
MLopez-Ibanez added a commit that referenced this pull request Nov 29, 2025
@MLopez-Ibanez MLopez-Ibanez deleted the hv3d+-bugfix branch November 29, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants