def connectedSet(self, nodes):
        rets = []
        visisted = set()
        for node in nodes:
            if node not in visisted:
                ret = []
                self.dfs(node, visisted, ret)
                ret.sort()
                rets.append(ret)

        return rets
Connected component rather than clique
dataset/ETHPy150Open algorhythms/LintCode/Find the Connected Component in the Undirected Graph.py/Solution.connectedSet