#14411: Disjoint Sets --> iter
---------------------------------------+------------------------------------
       Reporter:  elixyre              |         Owner:  jason, ncohen, rlm
           Type:  enhancement          |        Status:  needs_review      
       Priority:  major                |     Milestone:  sage-5.10         
      Component:  misc                 |    Resolution:                    
       Keywords:                       |   Work issues:                    
Report Upstream:  N/A                  |     Reviewers:  Travis Scrimshaw  
        Authors:  Jean-Baptiste Priez  |     Merged in:                    
   Dependencies:                       |      Stopgaps:                    
---------------------------------------+------------------------------------

Comment (by tscrim):

 You're forgetting that this is not a dijoint union as a ''mathematical''
 object but a specific ''data structure'' of `DisjointSet` which is not a
 list of lists. In some sense, there is less structure as `DisjointSet` is
 better described as a map from elements to a representative (in particular
 the subsets are not ordered). Thus the most logical behavior to me is that
 `__getitem__()` should match `find()`.

 Actually considering that, the iterator should the representatives (i.e.
 the `iterkeys()`) and not the subsets.

 To reiterate, this is a tool (class) used to solve problems efficiently,
 not to represent a mathematical structure. The mathematical structure
 you're after would either be `DisjointUnionEnumeratedSets` or
 `SetPartitions`. If you really want to return the whole subset from an
 element, this should get its own specialized method.

 Best,[[BR]]
 Travis

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14411#comment:9>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" 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-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to