graph = { "a" : ["c"], "b" : ["c", "e"], "c" : ["a", "b", "d", "e"], "d" : ["c"], "e" : ["c", "b"], "f" : [] } def genere_arretes(graph): edges = [] for node in graph: for neighbour in graph[node]: edges.append((node, neighbour)) return edges # Affiche les sommets print(list(graph.keys())) # Affiche les arrĂȘtes print(genere_aretes(graph)) # >>> [('a', 'c'), ('c', 'a'), ('c', 'b'), ('c', 'd'), ('c', 'e'), # ('b', 'c'), ('b', 'e'), ('e', 'c'), ('e', 'b'), ('d', 'c')]