adding an edge adding an edge to an existing graph involves treating the new vertex as tuple and validating if the edge is already present if notthen the edge is added class graphdef __init__(self,gdict=none)if gdict is nonegdict {self gdict gdict def edges(self)return self findedges(add the new edge def addedge(selfedge)edge set(edge(vrtx vrtx tuple(edgeif vrtx in self gdictself gdict[vrtx append(vrtx elseself gdict[vrtx [vrtx list the edge names 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 " [" "," "]" [" "" "]" [" "" "]" [" "]