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

Add FA2 option to stop after N iterations ? #514

Closed
RouxRC opened this issue Feb 2, 2015 · 7 comments
Closed

Add FA2 option to stop after N iterations ? #514

RouxRC opened this issue Feb 2, 2015 · 7 comments
Labels

Comments

@RouxRC
Copy link
Contributor

RouxRC commented Feb 2, 2015

It would be nice to be able to set FA2 to run for exactly a desired amount of iterations before autostopping, instead of having to use a setTimeout to stopForceAtlas2 which will result in various numbers of ran iterations depending on the client's machine and browser.

@Yomguithereal
Copy link
Collaborator

Rather than an option, the following method will probably be implemented:

s.runForceAtlas2Iterations(n);

@sheymann
Copy link
Contributor

sheymann commented Feb 3, 2015

An alternative implementation is available in:
https://github.com/Linkurious/linkurious.js/tree/linkurious-version/plugins/sigma.layout.forceAtlas2

Setting autoStop = true will force the algorithm to stop automatically when a quasi-optimal layout is reached.

@paulgirard
Copy link
Collaborator

quasi-optimal layout being defined by :

       // Auto stop.
      // The greater the ratio nb nodes / nb edges,
      // the greater the number of iterations needed to converge.
      if (W.settings.autoStop) {
        W.converged = (
          W.iterations > W.maxIterations ||
          alldistance / W.nodesLength < W.avgDistanceThreshold
        );
      }

For people doing Visual Network Analysis, this autostop feature might represents a problematic bias.

@RouxRC
Copy link
Contributor Author

RouxRC commented Feb 3, 2015

Hi,
Looking at your code, this does not really fit my needs since it seems like a "magic" setting with no user-control on it. At least if maxIterations and avgDistanceThreshold were configurable settings it would be better, but still, I'd prefer as @Yomguithereal proposed a runNIterations function, since you might want to do that sequentially in batches, and not stop forever the spatialization algorithm.
Moreover, I'm not really confident using a fork that seems to have left the road so far away from the official code. I'd rather keep things robust and stay on the official maintained code.

@sheymann
Copy link
Contributor

sheymann commented Feb 3, 2015

@RouxRC good point for the configurable settings, I'll add them.

@paulgirard The underlying problem is the inability to compute a "good number of iterations": too few the layout is not readable, too large you lose computation time. My approach is to stop the layout when nodes move too little, while keeping a tolerance to local minima. In a methodological point of view, the "stop" decision taken arbitrarily by a human is more problematic than having a public algorithm taking that decision, because such algorithm can be criticized, measured and improved, while the human decision is a black box called "expertise".

@paulgirard
Copy link
Collaborator

Well. Yes the problem is the inability to compute a "good number of iterations".
Mathieu Jacomy who wrote ForceAtlas2 tried to find a good way to define a methodology to stop iterations
He couldn't find any automatic/algorithmic way to define the moment to stop iterations that would work for any kind of network.
On complex networks this technique will not work.

Thus he chose not to add any autostop method in the paper about ForceAtlas published in PlosOne. You probably know that since you are a co-author.
We don't want to "sell" something that seems to be a methodological solution but is, in fact, just a side effect.

And yes, I do confirm that it's not a good idea to try to do that with ForceAtlas when you want to render any network.
And yes, I do think there is a methodological problem in doing that.
Letting the user decide when he thinks the algorithm reached an equilibrium or letting him decide how much time the algorithm need to spacialize at a certain level of quality has nothing to do with blackboxing.

Now, if you think that for Linkurious' clients, it's a good idea to do it, that's completely fine with me but some sigma.js users actually use it for science, in which case that 's highly insufficient.

Finally please don't try to bullshit me about blackboxing.

@stale
Copy link

Stale bot commented Oct 9, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale Stale bot added the wontfix label Oct 9, 2021
@stale Stale bot closed this as completed Oct 24, 2021
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

4 participants