In [5]:
def make_graph(phrase):
    oc = None
    hash = {}
    for c in list(phrase):
        if(oc):
            if(oc in hash): hash[oc].append(c)
            else: hash[oc] = [c]
        oc = c
    DiGraph(hash).show(figsize=(5,5))
    
make_graph('Natural Selection')