Graph theory method to solve the problem of class conflict