Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Network Question: Performance ~20k Nodes & 35k Edges #2741

Closed
mkollers opened this issue Feb 16, 2017 · 11 comments
Closed

Network Question: Performance ~20k Nodes & 35k Edges #2741

mkollers opened this issue Feb 16, 2017 · 11 comments

Comments

@mkollers
Copy link

mkollers commented Feb 16, 2017

Hey guys,

i'm currently working on a project, in which it would be nice to display a really large network graph. At the moment i have 21,012 nodes and 35,242 edges, and vis will draw it! So first of all: Great job, great lib, thanks!

But the physics positioning wasn't finished after 16 hours :-( My Idea is to build a server side worker, which run's prerenders the graph, and saves the positions of the nodes. But ~24h hours is a bit to much for the prerender duration.

Currently i'm working with the following options:

{
    nodes: {
        shape: 'dot',
        borderWidth: 2,
        font: {
            face: 'Roboto, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif',
            size: 14
        }
    }, edges: {
        arrows: {
            from: false,
            to: true
        },
        scaling: {
            min: 12
        },
        smooth: {
            type: 'continuous'
        },
        width: 1,
        font: {
            face: 'Roboto, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif',
            size: 14
        }
    }, layout: {
        randomSeed: 34,
        improvedLayout: false
    }, physics: {
        stabilization: false,
        barnesHut: {
            gravitationalConstant: -80000,
            springConstant: 0.001,
            springLength: 200
        }
    }, interaction: {
        hideEdgesOnDrag: true
    }

Can anyone provide some improvements for the performance?

@Tooa
Copy link
Member

Tooa commented Feb 16, 2017

How does your graph look like? Is it quite dense? If this is the case you could test this new pull request. Why don't you use improvedLayout (reference)? Also check out this example.

@Tooa
Copy link
Member

Tooa commented Feb 20, 2017

You might also want to try this additional pull request. Can you give feedback on both?

@mkollers
Copy link
Author

Ho Tooa,

thanks for your replies. My Graph looks like the following after 16h rendering:
download

Now i will check your links :-)

@mkollers
Copy link
Author

ok, i found the reason why i disabled improved layout:

image

I'm still working on trying out the pull request :-)

@Tooa
Copy link
Member

Tooa commented Feb 21, 2017

Yes, pls test the pull request and give feedback. Can you also share your graph via jsbin.com?

@wimrijnders
Copy link
Contributor

@mkollers I'm prepared to put in some time to look at stabilization optimization for huge networks. Is it possible to get example data of that gorgeous network of yours?

@mkollers
Copy link
Author

Sorry for the late reply. Unfortunately I can not share the data, because it is customer related :-( We also paused the project :-(

@wimrijnders
Copy link
Contributor

@mkollers No problem, it was wishful thinking on my part. It's just that I don't get test-data of that size from the field, so it's quite hard to do those monster tests.

For the record, the pull request in question has been merged with release v4.20.0. You might as well upgrade to that instead of fiddling with the pull request.

Also, I have to ask: have you experimented with option physics.stabilization? I see that it's disabled in the example you gave. I would really try setting that to a really high value, e.g.:

physics: {
  stabilization: {
    enabled: true,
    iterations: 100000,   // YMMV
  }
}

What this wins you, is that screen updates are skipped while physics does it thing. The performance increase can be huge.

Finally, I think this is an intriguing option:

My Idea is to build a server side worker, which run's prerenders the graph, and saves the positions of the nodes

It's worth thinking about.

We also paused the project :-(

Oh, darn......never mind, then.

@wimrijnders
Copy link
Contributor

@mkollers Since you're not working any more on the given project, is it okay to close this issue?

@mkollers
Copy link
Author

mkollers commented Jun 6, 2017

Sure, thanks :-)

@wimrijnders
Copy link
Contributor

Thanks for your input! Over and out.

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

No branches or pull requests

4 participants