Murali-group / halp

Hypergraph Algorithms Package
GNU General Public License v3.0
95 stars 21 forks source link

I implemented the DINH model #25

Closed tylerkahn closed 10 years ago

tylerkahn commented 10 years ago

See here.

The good news is that I was able to implement the DINH model from the paper and our library generated it in a reasonable time (with some modification of core library classes, see my commits to Node and Hypergraph).

The problem is that generating the transition matrix takes too long. I left my computer running for a half hour and it didn't complete.

I tried both approaches:

a) Matrix multiplication of the incidence, weight, edge degree, and vertex degree matrices. This is _transition_matrix() at the bottom of directedHyperGraph.py. See here.

b) Directly computing each (u, v) cell in P. This is transition_matrix(). See here.

Both never finished. I had to memmap the matrices because Python can't store matrices that large in memory.

The image I tested on was only 154x115 pixels.

Not sure how to remedy this. I spent quite a bit of time on this so it's unfortunate it's not working.

tmmurali commented 10 years ago

On Wed, May 14, 2014 at 1:30 PM, Tyler Kahn notifications@github.comwrote:

The good news is that I was able to implement the DINH model from the paper and our library is generate it it in a reasonable time (with some modification of core library classes, see my commits to Node and Hypergraph).

The problem is that generating the transition matrix takes too long. I left my computer running for a half hour and it didn't complete.

You will have to use some sparse matrix approach. I have implemented very similar random walk and power iteration algorithms for undirected graphs in C++. The trick is not to create the full blown matrix but to store the graph in an adjacency list and implement matrix-vector multiplications by iterating over graph edges.

Let me know if this suggestion helps. Murali

I tried both approaches:

a) Matrix multiplication of the incidence, weight, edge degree, and vertex degree matrices. This is _transition_matrix() at the bottom of directedHyperGraph.py. See herehttps://github.com/tmmurali/hypergraph/blob/directed_random_walk/hypergraph/directedHyperGraph.py#L253 .

b) Directly computing each (u, v) cell in P. This is transition_matrix(). See herehttps://github.com/tmmurali/hypergraph/blob/directed_random_walk/hypergraph/directedHyperGraph.py#L303 .

Both never finished. I had to memmap the matrices because Python can't store matrices that large in memory.

The image I tested on was only 154x115 pixels.

Not sure how to remedy this. I spent quite a bit of time on this so it's unfortunate it's not working.

— Reply to this email directly or view it on GitHubhttps://github.com/tmmurali/hypergraph/issues/25 .

tylerkahn commented 10 years ago

That sounds like a good approach. Also seems that scipy has support for sparse matrices .