Skip to content

Conversation

@qoqosz
Copy link
Contributor

@qoqosz qoqosz commented Aug 23, 2024

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.

@praseodym
Copy link

praseodym commented Dec 23, 2024

I think you should rebase instead of merging master into this branch:

Merging is blocked
Merge is not an allowed merge method in this repository.
This branch must not contain merge commits.

@qoqosz
Copy link
Contributor Author

qoqosz commented Dec 24, 2024

@praseodym indeed, thanks for noticing.

@starovoid
Copy link
Collaborator

@qoqosz Hi, please rebase. I plan to include this in the next release.

@starovoid starovoid mentioned this pull request Mar 21, 2025
8 tasks
@qoqosz qoqosz changed the title Add Bron-Kerbosch algorithm for maximal cliques feat: Add Bron-Kerbosch algorithm for maximal cliques Mar 21, 2025
@qoqosz
Copy link
Contributor Author

qoqosz commented Mar 21, 2025

@starovoid sure, it's rebased now.

@starovoid starovoid modified the milestones: 0.9, 0.8 Mar 21, 2025
@starovoid starovoid self-requested a review March 22, 2025 08:52
@starovoid starovoid self-assigned this Mar 22, 2025
@starovoid
Copy link
Collaborator

It is also common for new algorithms to add a quickcheck property test in the tests/quickcheck.rs file.

@qoqosz
Copy link
Contributor Author

qoqosz commented Mar 22, 2025

@starovoid thanks for the feedback. I have moved an already existing test to tests/quickcheck.rs and applied some other minor changes, in line with recent development in master. Please let me know if you want me to apply any other improvements.

@starovoid
Copy link
Collaborator

@qoqosz Nice! Last request: please squash all commits into new one to simplify commits history.
You can use the following commands:

git reset $(git merge-base master $(git branch --show-current))
git add -A
git commit -m "Implement Bron-Kerbosch algorithm for maximal cliques"
git push --force

Copy link
Collaborator

@starovoid starovoid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything is great, thank you!

@starovoid starovoid added this pull request to the merge queue Mar 22, 2025
Merged via the queue into petgraph:master with commit d69ffb4 Mar 22, 2025
10 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Apr 5, 2025
A sufficient number of proposed changes have accumulated to combine them
and publish a new major release numbered `0.8.0`.


BREAKING CHANGE:

This will require the user to provide extra type parameter in some APIs
(Read more in #747).

## List of changes
- [x] #747
The main innovation of the current release, the long-awaited feature
that has become very relevant due to the transition of dependent
projects to support `no_std`.
- [x] #662 
- [x] #611
- [x] #728
- [x] #686
- [x] #737 
- [x] #720 
- [x] #718 

## Note
There are still a large number of PRs that we want to adopt in the near
future, so we should expect at least a release of `0.8.1` soon after the
completion of `0.8.0`.

Thank you all for participating!

---------

Co-authored-by: Agustin Borgna <agustinborgna@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-new-algorithm Category: A feature request for a new graph algorithm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants