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

Buggy behavior when Allow Nodes In Circles enabled #27

Closed
hasanbalci opened this issue May 25, 2021 · 4 comments
Closed

Buggy behavior when Allow Nodes In Circles enabled #27

hasanbalci opened this issue May 25, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@hasanbalci
Copy link
Contributor

hasanbalci commented May 25, 2021

Sometimes, cluster circles are laid out too wide when allowNodesInsideCircle option is enabled. A sample case to reproduce:

  • Import following graphml file: sample.txt
  • Enable Allow Nodes In Circles option from Layout Options
  • Run layout
    The resulting layout is not compact:
    image
@hasanbalci hasanbalci added the bug Something isn't working label May 25, 2021
herencalik added a commit that referenced this issue Jun 17, 2021
@herencalik
Copy link
Contributor

Now when an in-circle node has more than 5 neighbouring on-circle node, it's displacement is limited using the infinite series similar to one used in Zeno's paradox.
For example, when there are 6 on-circle neighbours of an in-circle node, it's displacement is multiplied by the coefficient:
1 - (0.5 - (0.5)^(6(number of neighbours) - 4)) = 0.5 + (0.5)^(6(number of neighbours) - 4)

@ugurdogrusoz
Copy link
Contributor

This might work for smaller large degrees but when we have really high degrees it doesn't.

We investigated this with @hasanbalci and here are our findings:

  • We limit the movement of a single node for inner nodes as well but we neglect (here) to multiply this max displacement value with the current cooling factor. We should do so (similar to how we do it here in cose layout).

  • Secondly, what we want to control high degree nodes is a function that more or less compensates for high degrees. In other words, as the degree of a node increases, the total force on that node should not be increasing arbitrarily. With this scheme, it still does:
    Screenshot 2021-06-18 095250

If we use a simple function like 4/(number of neighbors) as constraintCoefficient, for any degree (number of neighbors) d greater than 4, we still get a total force which is about 4 times an average force and this might work.

herencalik added a commit that referenced this issue Jun 22, 2021
- Node displacement is multiplied by cooling factor
- When an inner node has more than 4 on-circle neighbours, its displacement is multiplied by the coefficient:
4/(Number of on-circle neighbours)
@ugurdogrusoz
Copy link
Contributor

ugurdogrusoz commented Jun 22, 2021

This looks fixed to me. @hasanbalci please confirm and close if OK.

@hasanbalci
Copy link
Contributor Author

Yes, it's very good now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants