#13223: Implement Poset.is_graded using a polynomial time (linear?) algorithm.
-------------------------------------+-------------------------------------
Reporter: nthiery | Owner: sage-combinat
Type: enhancement | Status: needs_work
Priority: minor | Milestone: sage-6.4
Component: combinatorics | Resolution:
Keywords: sd40 | Merged in:
Authors: Jori Mäntysalo | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/jmantysalo/implement_poset_is_graded_using_a_polynomial_time__linear___algorithm_|
a9896c7e9f9e8e6c6f52a25a3370c2d595e2fecf
Dependencies: #13222 | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by ncohen):
Oh. I thought that it would go unnoticed.
Well, try replacing the code of sinks/source from
{{{
return [x for x in self if self.out_degree(x)==0]
}}}
to
{{{
return [x for x,d in self.out_degree(labels=True).iteritems() if d==0]
}}}
It means less calls to `out_degree`. Perhaps that's what you detected ?
Nathann
--
Ticket URL: <http://trac.sagemath.org/ticket/13223#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.