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

Coarsening symmetric graphs leads to slightly asymmetric edge weights #2080

Merged
merged 12 commits into from
Feb 22, 2022

Conversation

seunghwak
Copy link
Contributor

@seunghwak seunghwak commented Feb 17, 2022

If you coarsen a symmetric (i.e. undirected) graph, the output graph should be symmetric as well.

However, due to limited floating point resolution, edge weights can be slightly asymmetric after coarsening (e.g. for a triplet of src, dst, weight, we may see (1, 2, 1.0) and its reverse edge (2, 1, 1.0 + 1e-7), this is only approximately symmetric and not strictly symmetric).

This PR fixes this by coarsening using only the lower triangular part (including the diagonal) after relabeling and reconstructing a symmetric graph from the lower triangular part (if the input graph is symmetric).

@seunghwak seunghwak added bug Something isn't working 3 - Ready for Review non-breaking Non-breaking change labels Feb 17, 2022
@seunghwak seunghwak added this to the 22.04 milestone Feb 17, 2022
@seunghwak seunghwak self-assigned this Feb 17, 2022
@seunghwak seunghwak requested a review from a team as a code owner February 17, 2022 18:06
@codecov-commenter
Copy link

codecov-commenter commented Feb 17, 2022

Codecov Report

❗ No coverage uploaded for pull request base (branch-22.04@d947fb9). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head df6eaca differs from pull request most recent head 57a0843. Consider uploading reports for the commit 57a0843 to get more accurate results

Impacted file tree graph

@@               Coverage Diff               @@
##             branch-22.04    #2080   +/-   ##
===============================================
  Coverage                ?   73.59%           
===============================================
  Files                   ?      156           
  Lines                   ?    10316           
  Branches                ?        0           
===============================================
  Hits                    ?     7592           
  Misses                  ?     2724           
  Partials                ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d947fb9...57a0843. Read the comment docs.

@BradReesWork
Copy link
Member

@gpucibot merge

@rapids-bot rapids-bot bot merged commit f80bce7 into rapidsai:branch-22.04 Feb 22, 2022
@seunghwak seunghwak deleted the bug_shrink_graph branch August 11, 2022 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants