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

Unstable optimisation in growing densely-connected graphs #104

Open
tomsmeding opened this issue May 15, 2019 · 0 comments
Open

Unstable optimisation in growing densely-connected graphs #104

tomsmeding opened this issue May 15, 2019 · 0 comments

Comments

@tomsmeding
Copy link

Consider the following code (using the springyui.js framework):

<!doctype html>
<html>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script src="springy.js"></script>
<script src="springyui.js"></script>
<script>
var graph = new Springy.Graph();
var nodes = [];

jQuery(function(){
  jQuery('#springydemo').springy({graph: graph});
});

var nodeIndex = 0;
var interval = setInterval(function() {
    nodes.push(graph.newNode({label: nodeIndex.toString()}));
    for (var i = 0; i < nodeIndex; i++) {
        if (Math.random() < 0.5) graph.newEdge(nodes[nodeIndex], nodes[i]);
    }
    nodeIndex++;
}, 1500);
</script>
<canvas id="springydemo" width="640" height="480"></canvas><br>
<input type="button" onclick="clearInterval(interval)" value="Stop generating nodes"/>
</body>
</html>

That is, every 1.5 seconds we add a new node that we connect to each existing node with probability 0.5. Invariably, after a couple of nodes (14 or so), the optimisation process seems to diverge, and even if you stop adding nodes by pressing the button, the layout does not converge.

Is this perhaps a known issue, or a limitation of the optimisation process?

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

No branches or pull requests

1 participant