I'm looking for an algorithm that solve Party problem. The party problem asks to find the minimum number of guests that must be invited so that at least 3 will know each other or at least 3 will not know each other. I know that the answer is 6 but i have to write a program that will check if 4 is enough, 5 people are enough, 6 ... 7 ... etc.
Edit: I want this unsophisticated algorithm, but i dont know how to enumerate all possible assignments and check whether they know each other.
I know what you mean, but on a certain level this question doesn't really make sense.
If you want a sophisticated algorithm, just check whether the input (number of guests) is below 6 or not. You already know that 6 is the number of guests required.
If you want an unsophisticated algorithm, given a number $n$ of guests, just enumerate all possible assignments of "knows" and "does not know" and check whether there are three people that either know each other or don't know each other.
This algorithm is obviously not very efficient. But it is likely that you can't do much better: the Ramsey number $R(4,4)$ is already not so easy to determine (it is 18, by the way), and $R(5,5)$ is not known. $R(5,5)$ is only known to be between 43 and 49 (see here).