Bron-Kerbosch algo for maximal cliques#72
Conversation
|
before I proceed in actually fixing the checks and adding some tests, are you actually interested in adding this algorithm to the library? |
|
Yes I think we want to add it. Some thoughts:
|
|
Hey!! thanks for the suggestions. I will work on them as soon as I get the chance. |
|
Does a reference implementation also not have a value in benchmarks? It gives a baseline that automatically adjusts for improvements in |
|
That sounds useful, but it doesn't mean that petgraph has to have it in its public API |
|
I agree it should not be in the public API. As far as I can tell, if it is not part of the public API then the tests and the benchmarks for the reference implementation must also be in the Also I reimplemented the algorithm using graph traits and it got about 2x faster. |
d318a84 to
ecb4830
Compare
|
That's good. I'm sure it can be sped up twice more, but that's not necessarily the most important thing before merging. |
|
This needs attention from me or others that volunteer to review. |
|
I haven't yet implemented your suggestion of using a bitmap. I just ran |
|
this is waiting on a PR to add the required methods to fixedbitset petgraph/fixedbitset#20 |
|
Thanks for pinging me. |
|
@jrraymond can you please rebase and update your PR? |
ecb4830 to
0c13389
Compare
0c13389 to
8b68fc0
Compare
|
This seems great, why hasn't it been merged? I am probably going to use this algorithm in my current project, so if I can help resurrect this PR I would love to contribute. |
This PR resurrects #72 by applying @jrraymond's changes to the recent (`0.6.5`) `master` branch with only minor code style changes. This also addresses a recent issue #620. The added algorithm enumerates maximal cliques in a graph by using Bron-Kerbosch algorithm with pivoting. Specifically, my added changes include: - extracting the algorithm to its separate file - adding a documentation with an example - moving the reference implementation to the tests file - modifying test cases so they do not take too long to run I did not apply the suggestion to use `FixedBitSet` instead of `HashMap` from the original PR as I don't know how to approach it for the generic graph.
Add Bron-Kerbosch algorithm for finding maximal cliques in a graph.