#19985: Add is_partial_cube
-------------------------------------+-------------------------------------
       Reporter:  jaanos             |        Owner:
           Type:  enhancement        |       Status:  needs_info
       Priority:  major              |    Milestone:  sage-7.1
      Component:  graph theory       |   Resolution:
       Keywords:  graphs partial     |    Merged in:
  cubes                              |    Reviewers:
        Authors:  Janoš Vidali       |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  618ab7378d84a24d2c572f58e4d7df23586ba80a
  u/jaanos/add_is_partial_cube       |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by jaanos):

 Hi!

 > This being said, isn't this of complexity `nm` already?
 >
 > {{{
 > +        for v, w in contracted.edge_iterator(labels = False):
 > +            diff = bitvec[v]^bitvec[w]
 > }}}

 The paper assumes that a machine word can store `log(n)` bits, so bitwise
 operations can be done in `O(d/log(n))` time, where `d` is the degree of
 the root (these sum up to at most `n-1` over all iterations of the
 contraction loop). Since the number of edges is checked to be `O(n
 log(n))`, the total time needed for bitwise operations is `O(n^2)`. Of
 course, failing this assumption, the time complexity here is indeed `O(nm)
 = O(n^2 log(n))`.

 > Another small thing: `len(contracted[v])` should be
 `contracted.out_degree(v)` (does not build the list of neighbors).

 Will take care of that.

 Janoš

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