JuliaGraphs / Graphs.jl

An optimized graphs package for the Julia programming language
http://juliagraphs.org/Graphs.jl/
Other
463 stars 92 forks source link

`clique_percolation` takes enormous memory and never finishes on a large graph #299

Open wangyi91 opened 1 year ago

wangyi91 commented 1 year ago

Description of bug Hello, I was using the clique_percolation function to detect communities. It works for some of my networks, but for some other a bit more complicated ones, e.g. with 25376 connections between 2646 nodes, I found that the computation is using enormous amount of memory and simply won't finish. May I ask if this could possibly be a bug? Thank you for helping.

How to reproduce Here I upload a network of mine in .jld2 format. You can simply unzip and read it in as netw=load_object("network.local.jld2") and transform it to graph using g=graph(netw). The computation I attempted is clique_percolation(g, k=3)

Expected behavior Output results within a few hours or even minutes.

Actual behavior Taking large memory (100+G) and never finishing.

Code demonstrating bug

netw=load_object("network.local.jld2")
g=graph(netw)
clique_percolation(g, k=3)

Additional context Attachment: network.local.jld2.gz

gdalle commented 1 year ago

This is an exponential time algorithm because it relies on the search for maximal cliques. Therefore, on large graphs, it is expected to perform badly. However, the original article on clique percolation seems to analyze graphs larger than that. Do you want to try and dig in, see if you can find the source of inefficiency?