-
Notifications
You must be signed in to change notification settings - Fork 304
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
Coarsening symmetric graphs leads to slightly asymmetric edge weights #2080
Conversation
…lower triangular part only and symmetrize to avoid (slightly) asymmetric edge weights due to the limited floating point precisions
Codecov Report
@@ 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.
|
@gpucibot merge |
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).