def chemins(start, end):
    pile = []
    pile.append((start, [start]))
    liste_chemins = []

    while pile:
        (S, path) = pile.pop()
        list_nodes = [n for n in G[S] if n not in path]
        for i in list_nodes:
            if i == end:
                liste_chemins.append(path + [i])
            else:
                pile.append((i, path + [i]))
                
    return liste_chemins

G = {
    'A' : ['B','D','E'],
    'B' : ['A','C'],
    'C' : ['B','D'],
    'D' : ['A','C','E'],
    'E' : ['A','D','G','F'],
    'F' : ['E','G'],
    'G' : ['E','F','H'],
    'H' : ['G']
}

print( chemins('A','H') )