Set this question as F.
Firstly, there are n people here and we need to divide the n people into 7 rooms. If there is a solution and we need to check whether it qualifies. There is a maximum of n people per room, we just need to check if they know anyone. If we use the adjacency matrix to store the relationships between people, it takes only O(n^2) time complexity to traverse through. Therefore, question F belongs to NP.
Secondly, Coloring question is known as a NP-complete problem.
Thirdly, there is an example show that we can reduce Coloring to F.
F: We set each person as a node and connect them if they know each other. In this situation, the relationships of all people can be stored in a graph.
In question Coloring, any two nodes of the same color cannot be adjacent to each other.
In F, any two people who know each other can be in a same room.
We create a graph like the relationships of F, and we tried to use 7 colors to paint the whole graph. If there is a solution the F can be solved, else it is not possible.
Above all, F reduces to Coloring question in polynomial time.