23
THE USUAL REMINDERS
- All of our rules, FAQs, resources, etc. are in our [community wiki](https:...
since 1 year ago
1 of 1
Tip Reveddit Real-Time can notify you when your content is removed.
your account history
Tip Check if your account has any removed comments.
view my removed comments you are viewing a single comment's thread.
view all comments


[LANGUAGE: Go]
Learned something completely new today.
Part One: Part one was easy, since a cycle of 3 isn't too big of an ask, I did a brute force and it worked perfectly. No optimizations needed whatsoever.
Part Two: Looking at the number of edges in the graph, I wasn't so sure if yet another brute force would work. I knew how I'd go about it but just to be sure, I did some quick Googling to see if there exists a standardized algorithm for this problem and the Bron-Kerbosch algorithm popped up.
Long story short, I spent the next hour and a half learning about the algorithm, how to implement it, what exactly it does and how it's (generally) a step up from Brute Force. Fun day today, learned quite a few new things about Graph theory and cliques.
Here is my solution for both parts. It's the standard recursive backtracking implementation for Bron-Kerbosch(although I'll be looking into the pivot one too, just later).