#15310: Wilson's construction of Transversal Designs/Orthogonal Arrays/MOLS
-------------------------+-------------------------------------------------
       Reporter:         |        Owner:
  ncohen                 |       Status:  needs_review
           Type:         |    Milestone:  sage-6.2
  enhancement            |   Resolution:
       Priority:  major  |    Merged in:
      Component:         |    Reviewers:
  combinatorics          |  Work issues:
       Keywords:         |       Commit:
        Authors:         |  f23fa885ee5a080f2a8051f23f7fc9f130541849
  Nathann Cohen          |     Stopgaps:
Report Upstream:  N/A    |
         Branch:         |
  u/ncohen/15310         |
   Dependencies:         |
  #15287, #15431         |
-------------------------+-------------------------------------------------

Comment (by vdelecroix):

 Hi Nathann,

 I am not sure I would be able to do the full review. Nevertheless, you can
 can speed up '''a lot''' the function `find_wilson_decomposition` using
 the fact that if a TD(k,n) exists then we have the inequality `k <= n+1`.
 Here is a sample version of what can be done:
 {{{
 def find_wilson_decomposition(k,n):
     # we can start from k-1 since we need a TD(k+1,t)
     for t in range(max(1,k-1),n-1):
         u = n%t
         # We ensure that 1<=u and
         # u <= k-2 since we need a TD(k,u)
         if u == 0 or u <= k-2:
             continue

         m = n//t

         # k < m+2 since we need a TD(k,m)
         if k >= m+2:
             break

         if (transversal_design(k  ,m  , availability=True) and
             transversal_design(k  ,m+1, availability=True) and
             transversal_design(k+1,t  , availability=True) and
             transversal_design(k  ,u  , availability=True)):
             return k,m,t,u

     return False
 }}}

 You can check that there is no stupid call to `find_wilson_decomposition`
 with the following
 {{{
 sage: from sage.combinat.designs.orthogonal_arrays import
 find_wilson_decomposition
 sage: find_wilson_decomposition(7,71)
 (7, 8, 8, 7)
 sage: find_wilson_decomposition.get_cache() # get the list of cached
 values
 ...
 }}}

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