ASKSAGE: Sage Q&A Forum - Latest question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 23 Feb 2017 04:27:23 -0600to_directed() affects original graphhttps://ask.sagemath.org/question/36705/to_directed-affects-original-graph/ I've stumbled on what I think is a bug. When you create a directed graph from some original graph and then making changes on the new, this can affect the old one. I'm not sure if it should be like this and one should always copy the graph first. Here's a minimal example that for be gives an error "KeyError: 0".
G1=graphs.RandomGNP(5,0.5)
G1.plot(save_pos=True)
G2=G1.to_directed()
G2.delete_vertex(0)
G2.add_vertex(5)
G2.plot()
G1.plot()AckslThu, 23 Feb 2017 04:27:23 -0600https://ask.sagemath.org/question/36705/