#19197: LatticePoset: add breadth()
-------------------------------------+-------------------------------------
       Reporter:  jmantysalo         |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.9
      Component:  combinatorics      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Jori Mäntysalo     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/jmantysalo/latticeposet__add_breadth__|  
33610ad2c4327679b8dfc1d3af445fe4d9080e4a
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by ncohen):

 Hello,

 > For me the parameter name `distance` feels very clear.

 And it is not the graph-theoretic distance in the graph, right? Plus there
 may be vertices at distance 2 from your start vertex that *never* get
 explored because you set distance=3. Do we also agree there? This is due
 to the fact that a vertex is at 'distance' k from the source vertex in a
 DFS if "there exists a path of length k from the source vertex to it"
 (possibly a *very long* path) and that if this vertex is once discovered
 at 'distance' 10 000 it may not be 'rediscovered' again at distance 2.

 > Why? Doesn't it use more memory?

 no reason to. It may be trigger additional copies of the 'queue' list
 (unless we implement a deque), but that's all. Additionally, if this cost
 worries you then you probably shouldn't use list-comprehension in your
 code `:-P`

 > I am not sure about that. If I am right, it will make all 2-element
 antichains, then all 3-element antichains and so on. There will be many of
 them, only one is needed. (But the one must be the right one, of
 course...)

 With your algorithm: if the antichain {a,b,c} is not "locally minimal",
 then your code will test all antichains which contain the antichain
 {a,b,c} too. With `subset_with_hereditary_property` it would be filtered
 out.

 Nathann

--
Ticket URL: <http://trac.sagemath.org/ticket/19197#comment:17>
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to