- 
                Notifications
    
You must be signed in to change notification settings  - Fork 338
 
Fix ForceAtlas2 speed factor in prevent_overlapping mode #5295
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
Conversation
| 
           @MathisHammel Thanks for the PR and the great qork. I need to update the PR to point to branch-25.12  | 
    
| 
           /okay to test 526de3c  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @MathisHammel!
| 
           /ok to test bf37157  | 
    
| 
           @MathisHammel - Looks like your PR is failing one of the python tests. The AI analysis of your failure: I suspect your change results in a different expectation from the code.  | 
    
| 
           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  | 
    
          
 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.  | 
    
| 
           /ok to test d1e7df7  | 
    
    
      
        1 similar comment
      
    
  
    | 
           /ok to test d1e7df7  | 
    
| 
           @ChuckHastings Tests should now be fixed. Adding the speed factor effectively reduced the speed of nodes by a factor of 10, which prevented FA2 from converging properly in the 500 iterations that were initially allocated. For the  Testcases are calibrated to meet the following criteria: 
 I ran each test 100 times (was hoping to do 1000 but we only have a single RTX 2060 for now 😅) with and without  I also took this opportunity to add tests with  
 * for some reason, Barnes-Hut approximation actually gives a slightly better result here. I didn't investigate, but I believe exact computations on a tight layout won't converge as fast due to the strong repulsion force.  | 
    
| 
           While working on this, I also noticed that one important test was accidentally disabled by #5260: all tests regarding the callback were commented out (which is expected since the argument got removed), but this part about trustworthiness is still relevant to verify FA2 is working. I couldn't fix it easily because of other changes in vertex renumbering, I think the issue is beyond the scope of this PR so I'll let you decide if an issue should be created or perhaps a simple FIXME comment will do it for now.  | 
    
| 
           /ok to test 63e7d38  | 
    
| 
           Forgot to run pre-commit hooks, I just pushed a new commit to fix linting  | 
    
| 
           /ok to test f3545d7  | 
    
| 
           Looks like the AWS outage isn't quite over yet, seeing a lot of failing requests in the build:   | 
    
| 
           /merge  | 
    
Following up on #5260, it turns out our proposed implementation of
prevent_overlappingis 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: