On 13 Okt., 12:57, Jason Grout <jason-s...@creativetrax.com> wrote: > On 10/13/11 3:05 AM, P Purkayastha wrote: > > > It seems to be a more general bug in the function *graphs()*. Even this > > code fails to give any output: > > def isc(g): return g.is_clique() > > Genn = graphs(3, isc) > > [_ for _ in Genn] > > Read the documentation a little closer (or maybe the documentation needs > to be expanded...). The property function happens *before* all graphs > are generated, works in conjunction with the 'augment' parameter (which > defaults to 'edges').
The docstring is IMHO surprisingly unclear regarding that: INPUT: * ``vertices`` -- natural number. * ``property`` -- (default: ``lambda x: True``) any property to be tested on graphs before generation. (Ignored if ``deg_seq`` is specified.) I wouldn't have expected "any" there though... ;-) (And it doesn't refer to 'augment' at all.) > sage: list(graphs(3, lambda x: x.is_clique(), augment='vertices')) > [Graph on 0 vertices, Graph on 1 vertex, Graph on 2 vertices, Graph on 3 > vertices] Again, if vertices=3, from its description I wouldn't expect to get graphs with (also) *less* than 3 vertices in the first place, although the description of the parameter doesn't state anything but its type, and the first example, on the next "terminal page", clearly shows that 'vertices' can also be an upper bound. -leif -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org