> It seems that your SearchGraph is what is already implemented under 
> TransitiveIdeal in the same file than SearchForest... Can you check if it 
> is 
> redundant ? 
>

It is indeed redundent. I did search for a SearchGraph implementation in 
Sage. I saw the comment """"See also "GenericBacktracker", 
"TransitiveIdeal", and "TransitiveIdealGraded".""" in the documentation of 
SearchForest. But, I was sure TransitiveIdeal was for something else. Of 
course, if I had read the line """Returns the set S of elements that can be 
obtained by repeated application of "relation" on the elements of 
"generators".""" inside the documentation of TransitiveIdeal, then I would 
not have coded a SearchGraph class. By chance, my SearchGraph code was no 
more than 20 lines.

So, what about the following common interface for forests, graded graph and 
graphs :

class RecursiveSet:
    def __init__(self, roots, children, structure=None, 
other_arguments_like_post_process):
         r"""
         Returns the set S of elements that can be 
         obtained by repeated application of "children" 
         on the elements of "roots".

          INPUT:
    
             * "roots" : a list (or iterable)
    
             * "children" : a function returning a list (or iterable, or
               iterator)

             * "structure" : string (default=None), can take one 
                of the following values:
                 * "tree" or "forest" : each element of the set 
                   can be reached by a unique sequence of 
                   application of children rules
                 * "graded" : one or more sequences of 
                   application of children rules can lead to the same
                   element, but they all have the same length
                 * None : no structure is assumed on the set
           """

Sébastien

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to