#13917: IndependentSets class
-------------------------+-------------------------------------------------
Reporter: | Owner: jason, ncohen, rlm
ncohen | Status: needs_review
Type: | Milestone: sage-6.2
enhancement | Resolution:
Priority: major | Merged in:
Component: graph | Reviewers: ahmorales
theory | Work issues:
Keywords: | Commit:
Authors: | 1be18a591f289740796242cfe07d7736801301d8
Nathann Cohen | Stopgaps:
Report Upstream: N/A |
Branch: |
u/ncohen/13917 |
Dependencies: |
#14589 |
-------------------------+-------------------------------------------------
Changes (by ncohen):
* commit: => 1be18a591f289740796242cfe07d7736801301d8
* branch: => u/ncohen/13917
Old description:
> I'm rather disappointed by this patch. Or I'm pleasantly surprised by
> Python, I don't know. I expected a much better speedup.
>
> {{{
> sage: g = graphs.RandomGNP(50,.7)
> sage: import networkx
> sage: gn = g.networkx_graph()
> sage: %timeit list(networkx.find_cliques(gn))
> 10 loops, best of 3: 48.8 ms per loop
> sage: from sage.graphs.independent_sets import IndependentSets
> sage: %timeit list(IndependentSets(g,complement=True, maximal = True))
> 10 loops, best of 3: 20.8 ms per loop
> sage: %timeit IndependentSets(g,complement=True, maximal =
> True).cardinality()
> 100 loops, best of 3: 19 ms per loop
> }}}
>
> Either way, this patch implements a `sage.graphs.independent_set` module
> that can list/count (possibly maximal) independent sets. While right now
> we can only compute the maximal ones.
>
> Nathann
>
> Apply:
>
> * [attachment:trac_13917-v2.patch]
> * [attachment:trac_13917-v2-more_doc.patch]
> * [attachment:trac_13917-doctests.patch]
New description:
I'm rather disappointed by this patch. Or I'm pleasantly surprised by
Python, I don't know. I expected a much better speedup.
{{{
sage: g = graphs.RandomGNP(50,.7)
sage: import networkx
sage: gn = g.networkx_graph()
sage: %timeit list(networkx.find_cliques(gn))
10 loops, best of 3: 48.8 ms per loop
sage: from sage.graphs.independent_sets import IndependentSets
sage: %timeit list(IndependentSets(g,complement=True, maximal = True))
10 loops, best of 3: 20.8 ms per loop
sage: %timeit IndependentSets(g,complement=True, maximal =
True).cardinality()
100 loops, best of 3: 19 ms per loop
}}}
Either way, this patch implements a `sage.graphs.independent_set` module
that can list/count (possibly maximal) independent sets. While right now
we can only compute the maximal ones.
Nathann
--
Comment:
(now with a git branch)
----
New commits:
||[http://git.sagemath.org/sage.git/commit/?id=cc8d994d4d59309ff45755d55337e1f18cbae7d3
cc8d994]||{{{trac #13917: IndependentSets class}}}||
||[http://git.sagemath.org/sage.git/commit/?id=d01cefb56b74b3f5e423bd86735ada4526ce8e35
d01cefb]||{{{trac #13917: add more documentation}}}||
||[http://git.sagemath.org/sage.git/commit/?id=1be18a591f289740796242cfe07d7736801301d8
1be18a5]||{{{trac #13917: doctests}}}||
--
Ticket URL: <http://trac.sagemath.org/ticket/13917#comment:24>
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.