A bunch of people on Facebook would like to find out the largest clique among them.
(Maybe this will be the next Facebook application?)
A clique is defined as a group of people where everyone is friends with everyone else.
Given a list of friends (friendship works both ways), your job is to output the size of this clique.
For the sake of privacy (and your convenience), we have replaced the names of the people with numbers.
Input Specification
Number of people, .
Number of friendships, .
lines, each with numbers meaning that and are friends.
There will be no duplicate edges.
NOTE: of test cases will have .
Output Specification
The size of the maximum clique.
Sample Input
6 7
2 3
2 4
2 5
3 4
3 5
4 5
5 6
Sample Output
4
Friends form the largest clique.
Comments