I have a question about the code of recursively enumerated sets
inside sets/recursively_enumerated_sets.pyx.
Such recursive structures
contain the extra information about a path from the seeds to a given
node (which is indeed a shortest path for breadth first search). Since
the successor function is an iterable, one can keep track of which
next a yields a given element.
Example:
sage: succ = lambda a:[a+2,a+3]
sage: C = RecursivelyEnumeratedSet([0], succ)
sage: C
A recursively enumerated set (breadth first search)
sage: it = C.breadth_first_search_iterator()
sage: [next(it) for _ in range(10)]
[0, 2, 3, 4, 5, 6, 8, 9, 7, 10]
But one could also keep track of how one of these ints is obtained:
sage: it = C.breadth_first_search_iterator()
sage: [next(it) for _ in range(10)]
[ (0, []), (2, [0]), (3, [1]), (4, [0,0]), (5, [2,3]), (6, [3,3]),
(8, [2,3,3]), (9, [3,3,3]), (7, [3,2,2], (10, [3,3,2,2])]
Actually, one problem is already apparent there: the order does depend
on the iterator through a set (and so would the word if succ returns a
set), so I don't think this is stable among different machines. But if
succ returns a determined iterator (contrary to a pseudo-random
iterator), the word makes prefect sense.
Reason for me to want that: I want to use this iterator for reflection
groups generated by simple reflections, and I want to keep track of
the used reduced word of the elements.
Do you think that's reasonable? Do you see a problem with this
implementation speedwise?
Thanks,
Christian
--
You received this message because you are subscribed to the Google Groups
"sage-devel" 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-devel.
For more options, visit https://groups.google.com/d/optout.