Hello. This is certainly due to the way Python manages unhashable variables. If you type p6 is c6, you will obtain True, in other words, p6 and c6 are two references to the same object.
Using p6=c6.copy() will do the job. Best regards. Christophe BAL 2014-03-12 21:42 GMT+01:00 Ken Levasseur <[email protected]>: > I want to examine graphs I get by removing single edges from an initial > graph and I've run into a problem. Here it is: > > For example, I start with > > c6=graphs.CycleGraph(6) > a=c6.edges()[0] > p6=c6 > p6.delete_edge(a) > > > Now if I do this: > > p6.is_tree() > > > I get the output I expect, True. > > However, if evaluate the following, I also get True > > c6.is_tree() > > > Removing the edge from p6 also removes it from c6. So p6 and c6 seem to > be pointers to the same structure. How do I create a truely new graph out > of the original? > > Ken Levasseur > UMass Lowell > > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
