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

initialization is ignored after one iteration #8

Closed
falexwolf opened this issue May 2, 2018 · 3 comments
Closed

initialization is ignored after one iteration #8

falexwolf opened this issue May 2, 2018 · 3 comments
Assignees
Labels

Comments

@falexwolf
Copy link

Hi! This a very nice package!

This should be very easy to reproduce for you, if not I'll assemble a small-scale example: after one iteration, no trace of the init pos is visible in the layout, it looks almost random. After 0 iterations, one perfectly recovers the provided initial positions. Is this behavior intended!

Alex

@bhargavchippada
Copy link
Owner

Thanks, Alex. Maybe the initial positions you provided are far from equilibrium so the forces in the graph were strong enough to move them a lot in just one iteration?
The algorithm tries to reach equilibrium as fast as possible so there are no guarantees the final state (or state after 1 iteration) will look similar to initial positions provided.
I believe you can decrease jitterTolerance for lower speed and more precision, that way maybe you can find traces of inititial positions after 1 iteration... See if this and tweaking other parameters helps :)

@falexwolf
Copy link
Author

Thank you! The initial positions should be pretty close to what is optimum... They are from UMAP and other topology-aware methods...

Thanks for the jitterTolerance hint. I'll play around a bit more and hopefully have time to prepare something reproducible for you...

Interestingly, the final layout still seems to remember my initial positions after, say 100 iterations. Then, the global topology absolutely matches what I provided as initial positions... That's kind of a really weird effect.

PS: I'm looking at a very hard large-scale case where it's impossible to compute something meaningful with random initialization...

@bhargavchippada
Copy link
Owner

I believe what is happening is that the initial positions you are providing are scaled up/down values of the positions in the final equilibrium state. For instance: the distance between nodes according to init pos is 2x times the distance between nodes in final state according to forceatlas2. In this case, the attractive spring forces (edges) are higher than repulsive charged node forces so the graph will compress. Visually both the initial positions and final positions are same but the distances between the nodes must have changed. scalingRatio parameter controls how much repulsion you want (More makes a more sparse graph). Let me know if this is the issue. You should be able to check using initial and final distance between nodes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants