display graph edges finding the graph edges is little trickier than the vertices as we have to find each of the pairs of vertices which have an edge in between them sowe create an empty list of edges then iterate through the edge values associated with each of the vertices list is formed containing the distinct group of edges found from the vertices class graphdef __init__(self,gdict=none)if gdict is nonegdict {self gdict gdict def edges(self)return self findedges(find the distinct list of edges def findedges(self)edgename [for vrtx in self gdictfor nxtvrtx in self gdict[vrtx]if {nxtvrtxvrtxnot in edgenameedgename append({vrtxnxtvrtx}return edgename create the dictionary with graph elements graph_elements " [" "," "]" [" "" "]" [" "" "]" [" "]" [" " graph(graph_elementsprint( edges()when the above code is executedit produces the following result