Skip to content

Conversation

MathisHammel
Copy link
Contributor

Following up on #5260, it turns out our proposed implementation of prevent_overlapping is missing a small detail that degrades the quality of the result.

Indeed, the notes in the ForceAtlas2 paper mention "we also implemented a diminishing factor on the local speed (dividing it by 10)" when the feature is enabled, which is not present in our previous PR. Without this factor, overlapping nodes tend to be ejected very fast and the algorithm does not converge properly.

The implementation of this PR matches the corresponding function in Gephi, slightly different than explained in the paper.

The render below was performed with cuGraph before and after applying the modification, which shows a significant improvement in the quality of overlap prevention:

image

@MathisHammel MathisHammel requested a review from a team as a code owner October 2, 2025 12:13
Copy link

copy-pr-bot bot commented Oct 2, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@BradReesWork
Copy link
Member

@MathisHammel Thanks for the PR and the great qork.

I need to update the PR to point to branch-25.12

@BradReesWork BradReesWork changed the base branch from branch-25.10 to branch-25.12 October 2, 2025 17:42
@BradReesWork BradReesWork added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Oct 2, 2025
@rapidsai rapidsai deleted a comment from copy-pr-bot bot Oct 2, 2025
@BradReesWork
Copy link
Member

/okay to test 526de3c

Copy link
Contributor

@eriknw eriknw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @MathisHammel!

@ChuckHastings
Copy link
Collaborator

/ok to test bf37157

@ChuckHastings
Copy link
Collaborator

@MathisHammel - Looks like your PR is failing one of the python tests. The AI analysis of your failure:

The failure occurred in test_force_atlas2_noverlap[500-graph_file3-10.0-1100] with the assertion assert 4041 < 1100. This means the test expected fewer than 1100 overlapping vertex pairs, but 4041 were found.
 * The test in python/cugraph/cugraph/tests/layout/test_force_atlas2.py expects that, after running Force Atlas 2 with prevent_overlapping enabled, the number of overlapping vertex pairs should be "very low" (see the threshold max_overlaps).
 * For the netscience graph (graph_file3), the test failed because the overlap count was much higher than expected.
 * This could be due to changes in the layout algorithm, differences in graph structure, or insufficiently strict parameters.

I suspect your change results in a different expectation from the code.

@MathisHammel
Copy link
Contributor Author

Yup, I was investigating that just now. The thresholds for this family of tests were determined from 500 runs of the algorithm in its previous (incorrect) version, I'll need to recompute parameters properly because I suspect the 0.1x speed factor requires more iterations to converge.

I can do that after next week, feel free to set this PR as draft/closed in the meantime

@ChuckHastings
Copy link
Collaborator

I can do that after next week, feel free to set this PR as draft/closed in the meantime

No need. The PR doesn't consume any CI resources unless we manually trigger things to rerun. We'll know it needs work because discussed it and it's logged here in the PR.

@ChuckHastings
Copy link
Collaborator

ChuckHastings commented Oct 7, 2025

/ok to test d1e7df7

1 similar comment
@ChuckHastings
Copy link
Collaborator

/ok to test d1e7df7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants