id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,merged,author,reviewer,upstream,work_issues,branch,commit,dependencies,stopgaps
19526,Certain methods fail on immutable graphs,jaanos,,"The following methods fail for immutable graphs:
* `GenericGraph.disjoint_routed_paths`
* `GenericGraph.genus`
* `GenericGraph.is_circular_planar`
* `GenericGraph.is_cut_edge`
* `GenericGraph.is_interval`
* `GenericGraph.layout_planar`
* `GenericGraph.multicommodity_flow`
* `GenericGraph.set_planar_positions`
* `GenericGraph.steiner_tree`
* `GenericGraph.to_simple`
* `GenericGraph.vertex_disjoint_paths`
* `Graph.gomory_hu_tree`
* `Graph.is_long_antihole_free`
* `Graph.is_long_hole_free`
* `Graph.is_weakly_chordal`
* `Graph.join`
* `Graph.seidel_switching`
* `Graph.topological_minor`
* `Graph.tutte_polynomial`
I have changed these methods (or ones they depend on) to make a copy of the appropriate (sub)graph if one is needed. To prevent making unneeded copies of (potentially large) graphs, the methods `to_directed`, `to_undirected`, `to_simple`, `subgraph`, `disjoint_union`, `union` and `join` now take an additional parameter `immutable` specifying whether the returned graph should be mutable or not (with the default `None` specifying the old behaviour, i.e. keeping the mutability of the input).
A minor exception is the `subgraph` method, which would always return a mutable graph when the ""add"" algorithm was being used, but this is now made consistent with the ""delete"" algorithm and other methods.
The reason I need these methods to work on immutable graphs is that I am part of a team building a database of graphs with precomputed attributes (so the graphs being mutable would make no sense) which will be accessible through Sage - of course we still want to do stuff with the graphs that won't change them.",defect,closed,major,sage-6.10,graph theory,fixed,"graphs, immutable",ncohen,,Janoš Vidali,Nathann Cohen,N/A,,c5ff5104ee2671ff61fd7de36cc696265e4c4c4c,,,