<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def validate(self):
 """ Simulataneously checks for loops and unreachable nodes """

        msg = list()
        previously_seen = set()
        currently_seen = set([1])
        problemset = set()
        while currently_seen:
            node = currently_seen.pop()
            if node in previously_seen:
                problemset.add(node)
            else:
                previously_seen.add(node)
                self.add_descendants(node, currently_seen)

        unreachable = self.all_nodes - previously_seen
        if unreachable:
            msg.append("%d unreachable nodes: "%len(unreachable))
            for node in unreachable:
                msg.append(str(node))

        if problemset:
            msg.append("Loop involving %d nodes"%len(problemset))
            for node in problemset:
                msg.append(str(node))

        if msg:
            return msg
        else:
            return True