words = ['abc', 'def', 'adf', 'adc', 'acf', 'dec']
bigramMap = {k: {''.join(x) for x in itertools.permutations(k, 2)} for k in
    words}
wordMap = defaultdict(set)
for word, bigramSet in bigramMap.items():
    for bigram in bigramSet:
        wordMap[bigram].add(word)
result = defaultdict(set)
for k, v in wordMap.items():
    for word in v:
        result[word] |= v ^ {word}
for word in words:
    pass
BFS, wanting to find the longest path between nodes, reducing the findchildren-method