Skip to content
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

tools: scale and shift vertex and edge weights for METIS and SCOTCH #224

Merged
merged 2 commits into from
Sep 26, 2022

Conversation

hhirtz
Copy link
Member

@hhirtz hhirtz commented Sep 22, 2022

These tools cannot handle null weights for vertices nor edges, so the input weights are "zoomed in" so that the sum of the weights plus one is INT_MAX.

Closes #220

TODO

  • edge weights are scaled independently from vertex weights, decide whether this is good or bad and add a comment
  • recover multi-criteria support for metis
  • return an iterator instead of a Vec rustc panic :s

@codecov
Copy link

codecov bot commented Sep 22, 2022

Codecov Report

Base: 52.11% // Head: 51.85% // Decreases project coverage by -0.25% ⚠️

Coverage data is based on head (caa8e19) compared to base (377fff5).
Patch coverage: 2.77% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #224      +/-   ##
==========================================
- Coverage   52.11%   51.85%   -0.26%     
==========================================
  Files          37       37              
  Lines        6699     6734      +35     
==========================================
+ Hits         3491     3492       +1     
- Misses       3208     3242      +34     
Impacted Files Coverage Δ
tools/src/lib.rs 0.19% <2.77%> (-0.02%) ⬇️
src/algorithms/vn/first.rs 93.85% <0.00%> (+0.87%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@cedricchevalier19
Copy link
Member

edge weights are scaled independently from vertex weights, decide whether this is good or bad and add a comment

Seems OK to me.

It's useful for naming T::one() and T::zero().
These tools cannot handle null weights for vertices nor edges, so the
input weights are "zoomed in" so that the sum of the weights plus one is
INT_MAX, and then shifted by one.

zoom_in() returns a Vec<O> directly, since it's what SCOTCH and METIS
want. I tried to make it a `impl Iterator<Item = impl Iterator<Item=O>>`
though it made rustc crash.
@hhirtz hhirtz merged commit 5d463f2 into master Sep 26, 2022
@hhirtz hhirtz deleted the zoom-factor branch September 26, 2022 10:18
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.

Robust conversion of weights from floating point to integer
2 participants