Я новичок в networkx. Хотя я нашел способ ответить на ваш вопрос, возможно, есть гораздо лучшее решение.
Я использовал этот код для решения вашего вопроса.
import networkx as nx
# suppose we have a graph, called g
# and a certain weight that we are interested in is cw
myedges = nx.edges(g) # this will make a list of edges
for e in myedges:
if g[e[0]][e[1]]['weight'] == cw:
my_target_edge = e
print(my_target_edge) # in case you find more than one edge