Maximal cliques — Bron–Kerbosch

Find every group where everyone knows everyone else and no other person knows the whole group. A group of three friends can qualify even if a larger group exists elsewhere.

Keep three lists: the group, candidates, and vertices already considered. After adding someone, keep only their neighbors as candidates. Even a small group is reported if it cannot grow.

Search explores exponentially many branches. The scene supports up to 10 vertices.