Skip to content

Improve scalability of centrality computation using sparse matrix#969

Closed
sandeepvaday wants to merge 3 commits intonetworkx:masterfrom
sandeepvaday:master
Closed

Improve scalability of centrality computation using sparse matrix#969
sandeepvaday wants to merge 3 commits intonetworkx:masterfrom
sandeepvaday:master

Conversation

@sandeepvaday
Copy link
Copy Markdown

To enable computation of eigenvector centrality scores for all nodes, in a graph with more than just a few thousand nodes, I have used sparse matrix representation here. Please take a look.

A note:

k=6 is the default

@chebee7i
Copy link
Copy Markdown
Member

chebee7i commented Oct 7, 2013

Also, since we don't have a hard dependency on scipy, maybe it would be better to make another function?

@dschult
Copy link
Copy Markdown
Member

dschult commented Oct 7, 2013

Sometimes it is better to use sparse and sometimes it is better to use
dense. We could try to include code that chooses, but perhaps its better
to have the user decide.

Also, in looking at the PR, there is a function smat used. What is that?
or did I read it wrong.
Dan

On Sun, Oct 6, 2013 at 8:35 PM, chebee7i notifications@github.com wrote:

Also, since we don't have a hard dependency on scipy, maybe it would be
better to make another function?


Reply to this email directly or view it on GitHubhttps://github.com//pull/969#issuecomment-25780390
.

@sandeepvaday
Copy link
Copy Markdown
Author

@chebee7i @dschult Apologies, i just missed copying over the smat() from my implementation

  • Have made the use of sparse matrix optional.
  • Do we still need to separate this functionality?

@hagberg
Copy link
Copy Markdown
Member

hagberg commented Oct 8, 2013

Can we just use to_scipy_sparse_matrix() instead of smat?

There is discussion in #913 about using sparse matrices for all of the linear algebra operations in NetworkX.

@sandeepvaday
Copy link
Copy Markdown
Author

My first attempt was to utilize to_scipy_sparse_matrix() but it resulted in an exception which I could not debug and had to proceed with my own implementation. I can attempt to recreate that exception if necessary.

Using sparse matrices would indeed be a good idea. This is an implementation that I have been using for my own work which makes it applicable for large graphs. So I thought I'd share it.

@hagberg
Copy link
Copy Markdown
Member

hagberg commented Oct 9, 2013

Using the sparse eigensolver is probably the right approach for large enough problems and I like the approach.
Could you post the exception so we can figure out how to fix the to_scipy_sparse_matrix() function?

@sandeepvaday
Copy link
Copy Markdown
Author

@hagberg Issue opened w.r.t to_scipy_sparse_matrix()

thanks

@hagberg
Copy link
Copy Markdown
Member

hagberg commented Nov 12, 2013

Can this be updated to use to_scipy_sparse_matrix() ?

@sandeepvaday
Copy link
Copy Markdown
Author

Yeah, I'm on it.

@ghost ghost assigned hagberg Nov 19, 2013
@hagberg hagberg mentioned this pull request Nov 27, 2013
hagberg added a commit to hagberg/networkx that referenced this pull request Jan 4, 2014
@hagberg hagberg closed this in e8afc73 Jan 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants