1 | initial version |

Hi,

The GraphQuery command is about consulting the database of small graphs. If you want to actually build the list from scratch use:

```
sage: from itertools import ifilter
sage: f = lambda g: g.is_connected() and not g.is_long_hole_free()
sage: for g in ifilter(f, graphs(6)):
....: print g
Graph on 6 vertices
Graph on 6 vertices
....
Graph on 6 vertices
```

If you want to create the list and not just iterate through them you can use

```
sage: L = filter(f, graphs(6))
sage: graphs_list.show_graphs(L)
```

Note that the same method would work with a graph query as well.

Vincent

2 | No.2 Revision |

Hi,

The GraphQuery command is about consulting the database of small graphs. If you want to actually build the list from scratch use:

```
sage: from itertools import ifilter
sage: f = lambda g: g.is_connected() and not g.is_long_hole_free()
sage: for g in ifilter(f, graphs(6)):
....: print g
Graph on 6 vertices
Graph on 6 vertices
....
Graph on 6 vertices
```

If you want to create the list and not just iterate through them you can use

```
sage: L = filter(f, graphs(6))
sage: graphs_list.show_graphs(L)
```

Note that the same method would work with a graph query as ~~well.~~well. But whatever you chose it will take forever with 9 vertices.

Vincent

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.