#20078: Minimal non faces of simplicial complexes: Improve speed
-------------------------------------+-------------------------------------
       Reporter:  jipilab            |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-7.1
      Component:  algebraic          |   Resolution:
  topology                           |    Merged in:
       Keywords:  simplicial         |    Reviewers:
  complex, minimal nonface           |  Work issues:
        Authors:  Jean-Philippe      |       Commit:
  Labbé                              |  a26ad0bfff0273656cebb060691056dd75fc2f7b
Report Upstream:  N/A                |     Stopgaps:
         Branch:                     |
  u/jipilab/minnonface               |
   Dependencies:                     |
-------------------------------------+-------------------------------------
Description changed by jipilab:

Old description:

> The current implementation to compute minimal non-faces of simplicial
> complexes is really slow:
>
> {{{
> sage: SC = SimplicialComplex([(0,1,2),
>  (0,2,3),
>  (2,3,4),
>  (1,2,4),
>  (1,4,5),
>  (0,3,6),
>  (3,6,7),
>  (4,5,7)])
> sage: %time SC.minimal_nonfaces()
> CPU times: user 11 s, sys: 140 ms, total: 11.2 s
> Wall time: 11.2 s
> {(3, 4, 7), (5, 6), (0, 4), (0, 5), (3, 5), (4, 6), (2, 5), (0, 7), (1,
> 3), (1, 7), (1, 6), (2, 6), (2, 7)}
> }}}
>
> This is a difficult problem but it seems that the algorithm could be
> improved with not too much efforts. I made a first try here:
>
> {{{
> sage: %time mnf(SC)
> CPU times: user 21.3 ms, sys: 4.25 ms, total: 25.6 ms
> Wall time: 26.6 ms
> {{3, 4, 7}, {0, 7}, {0, 4}, {0, 5}, {3, 5}, {1, 7}, {2, 5}, {5, 6}, {1,
> 3}, {4, 6}, {1, 6}, {2, 6}, {2, 7}}
> }}}

New description:

 The current implementation to compute minimal non-faces of simplicial
 complexes is really slow:

 {{{
 sage: SC = SimplicialComplex([(0,1,2),
  (0,2,3),
  (2,3,4),
  (1,2,4),
  (1,4,5),
  (0,3,6),
  (3,6,7),
  (4,5,7)])
 sage: %time SC.minimal_nonfaces()
 CPU times: user 11 s, sys: 140 ms, total: 11.2 s
 Wall time: 11.2 s
 {(3, 4, 7), (5, 6), (0, 4), (0, 5), (3, 5), (4, 6), (2, 5), (0, 7), (1,
 3), (1, 7), (1, 6), (2, 6), (2, 7)}
 }}}

 This is a difficult problem in general, but it seems that the algorithm
 could be improved with not too much efforts. I made a first try here:

 {{{
 sage: %time SC.minimal_nonfaces()
 CPU times: user 14 ms, sys: 12.4 ms, total: 26.4 ms
 Wall time: 30.5 ms
 {(3, 4, 7), (0, 7), (0, 4), (0, 5), (3, 5), (1, 7), (2, 5), (5, 6), (1,
 3), (4, 6), (1, 6), (2, 6), (2, 7)}
 }}}

--

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

Reply via email to