#19197: LatticePoset: add breadth()
-------------------------------------+-------------------------------------
       Reporter:  jmantysalo         |        Owner:
           Type:  enhancement        |       Status:  new
       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__|  
cd99bd6b82aaece6bd535d6fdfd01f7bfb28a8c5
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by ncohen):

 * commit:   => cd99bd6b82aaece6bd535d6fdfd01f7bfb28a8c5


Comment:

 Hello Jori,

 Here is a way to improve the algorithm a bit:

 Let us say that a set `S` is "locally_minimal" if the join of the elements
 in `S` is different from the join of the elements in <any proper subset in
 `S`>. What you are looking for is the set `locally_mininal` set of maximum
 cardinality.

 Why do you iterate on antichains? You iterate on antichains, because you
 know that in *any* "locally_minimal" set `S`, any 2-subset of `S` must be
 locally minimal. And the sets of locally minimal sets of cardinality 2 are
 precisely the antichains.

 Why wouldn't you go further? Indeed, the same works for anything greater
 than 2: in any locally minimal set, *any* proper subset is also locally
 minimal.

 Your implementation, however, does not use that. You test all antichains,
 but when testing those of size 5 you do not use the information obtained
 from those of size 4.

 So here is a way out: enumerate all locally minimal sets directly, in
 increasing order of size. This can be done with
 `subsets_with_hereditary_property` [1], to which you can feed a function
 that detects if a given set of points is locally minimal (when you remove
 only one element).

 This should do the trick, and *use* the information that <some given set
 of size 3 is not locally minimal> when trying to figure out one of size 4.

 Note: It may be slower for small cases, but better above.

 Additionally, your code may spend a lot of time hashing your elements: it
 may be better to work directly with the integer ID of the poset's elements
 (and to access the matrix directly).

 Also, could you be a bit more formal in the definition of 'breadth'? I did
 not follow it at first (english is not a well-paenthesized language). It
 would also be cool if you could redirect toward a textbook/paper that
 defines it: I found it in "Semimodular Lattices Theory and Applications"
 where it is said to originate from "Lattice Theory" by Birkhoff.

 Nathann

 [1]
 
http://doc.sagemath.org/html/en/reference/combinat/sage/combinat/subsets_hereditary.html
 ----
 New commits:
 
||[http://git.sagemath.org/sage.git/commit/?id=cd99bd6b82aaece6bd535d6fdfd01f7bfb28a8c5
 cd99bd6]||{{{Added function breadth() to lattices.}}}||

--
Ticket URL: <http://trac.sagemath.org/ticket/19197#comment:2>
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