Ruta NetworkX entre dos nodos

import networkx as nx

path = list(nx.shortest_path(G, source=0, target=1))
print(path)
Smoking Snake