def add_cycle(self, nodes, **attr):
        nlist = list(nodes)
        edges=zip(nlist,nlist[1:]+[nlist[0]])
        self.add_edges_from(edges, **attr)
Add a cycle.
dataset/ETHPy150Open gkno/gkno_launcher/src/networkx/classes/graph.py/Graph.add_cycle