On Tue, Jan 25, 2011 at 6:06 AM, Nathann Cohen <nathann.co...@gmail.com> wrote:
>> I just noticed that DiGraph produces graphs that are mutable. Is there
>> any alternative implementation of digraphs (with multiple edges) in
>> Sage that are immutable?
>
> Not to my knowledge.... Though you're not the first one to ask, and it may
> be sound to implement it eventually ^^;
>
> When dealing with graphs, there's a small workaround : store the
> graph6_string instead of the graph itself...

Or the dig6_string when working with digraphs :)

sage: G = DiGraph()
sage: for i in [0..9]:
    G.add_edge(i, randint(0,9))
....:
sage: DiGraph(G.dig6_string()) == G
True

However, these strings don't save nearly all the information of a
graph. For example, they store a graph on consecutive integer vertices
only.






-- 
Robert L. Miller
http://www.rlmiller.org/

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to