Hi,
   
> I always have to include in my graphs functions some part of code to deal
> with the fact that for undirected graphs edges can be returned as (u,v) or
> as (v,u), which my code does not like.... Isn't there a Sage a type of
> variable which is both immutable and not ordered ?
> 
> I'd love to have something like Set(u,v) but I also need it to be immutable,
> hashable, etc... ;-)

Precicely Sage Set are designed to be immutable and hashable. 

sage: Set((Set((2,3)), Set((1,2)), Set((2,3)) ))
{{1, 2}, {2, 3}}
sage: s = Set((Set((2,3)), Set((1,2)), Set((2,3)) ))
sage: len(s)
2
sage: Set((3,1)) == Set((1,3))
True

So what ? 

Cheers,

Florent

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to