| nikita ( @ 2004-06-27 17:40:00 |
| Current mood: | |
| Current music: | Video Killed the Radio Star - Erasure |
more on cliques
This is what I did instead of working today. Since I had most of the code for finding largest cliques, this morning I decided why not automate it and put it on the web? It was something fun to do, it game a chance to learn mod_python, ... and it took most of the day! But now you can go to http://nikita.ca/lj/clique.py and find a large clique that you're part of. It's probably the largest, but I make no guarantees). A clique, BTW, is a group of people who all list each other as friends.
To find the cliques, I used a heuristic search. Starting with you, I find your friend with whom you have the largest number of friends in common and add them to the clique. Then I pick the next person who has the most friends in common with the existing clique, and keep extending it this way until I find a maximal clique. This doesn't always give you the correct answer, so I do a bit of backtracking. At each step, I consider at least the 3 top friends. If there are many people tied for first, I consider them all, since it makes no sense to pick one over the other. So far the number 3 has been a good compromise between runtime and exploring a large enough state space. Of course, I don't know if there are larger cliques I'm not finding. And it's possible that once more people start using it, my web server will melt. (Maybe I'll have to rewrite it in C then...)
The largest clique I've found so far is still the size 15 one from my last entry. I've set up a log to see if any larger ones are found... UPDATE: The current winner has size 24! UPDATE2: Wow, there's a clique of size 137!
</p>The friends data is cached, so if you add someone to your friends list, the results won't change. UPDATE: Now there's a link to clear the cache for you and all your friends and recompute from scratch.