#10886: DisjointSet: number of sets function
---------------------------------------+------------------------------------
Reporter: rlm | Owner: jason
Type: enhancement | Status: needs_info
Priority: major | Milestone: sage-4.7
Component: misc | Keywords:
Author: Robert Miller | Upstream: N/A
Reviewer: Alexandre Blondin Massé | Merged:
Work_issues: |
---------------------------------------+------------------------------------
Changes (by abmasse):
* status: needs_review => needs_info
* reviewer: => Alexandre Blondin Massé
Old description:
New description:
The DisjointSet data structure in Sage lacks the function returning the
number of current subsets contained in it. The goal of this ticket is to
add this functionality.
--
Comment:
Hi, Robert!
I just took a look at your patch. Two remarks and a question:
1. The function `number_of_sets` you added is only defined for the
`DisjointSet_of_integers` class. You should add it as well to the
`DisjointSet_of_hashables`.
2. While you're at it, I suggest the name `number_of_subsets` instead of
`number_of_sets`, since we talk about partitioning a set into disjoint
subsets. It follows the terminology used in the first line of Wikipedia
(http://en.wikipedia.org/wiki/Disjoint-set_data_structure).
3. My question is mainly addressed to Sébastien but maybe you know the
answer. What is the reason for creating the class `DisjointSet_class`? It
says that it is supposed to contain functions common to all disjoint set
data structures, but it only contains two basic functions. Shouln't
functions such as `cardinality`, `number_of_sets`, etc. be there too?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10886#comment:4>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.