id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
13917 IndependentSets class ncohen jason ncohen rlm "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" enhancement closed major sage-6.2 graph theory fixed vdelecroix Nathann Cohen Vincent Delecroix N/A 635c88da8c6df73b9fdf94d95c0c4fa2fc7397b7 635c88da8c6df73b9fdf94d95c0c4fa2fc7397b7 #14589