# how to efficiently generate all directed graphs with 6 vertices

I am attempting to generate all non-isomorphic directed graphs with 6 vertices using command ListGraphs[6, Directed].But it does not work efficiently and takes a month producing nothing.

Can anyone suggest an alternative way to accomplish this goal?

• Did you actually wait for this for a full month? You know that you can download lists of these? Even GraphData has them up to size 7. If you want to generate them, then first create all symmetric adjacency matrices. You can use Range[2^15] and IntegerDigits in base-2 to get the 0s and 1s then fill them into a symmetric matrix (this requires some more complex code). Finally, use DeleteDuplicatesBy[..., CanonicalGraph] to filter isomorhic duplicates. Commented Apr 3, 2017 at 5:24
• Sorry, I missed the fact that they are directed. That means that GraphData doesn't have it, but you can still find graph tables online. The method above with CanonicalGraph will likely be too slow too. Commented Apr 3, 2017 at 5:36
• Thank you very much for your suggestions. Can you please point out a specific link via which I can find graph tables? I did some search online but couldn't find one.
– Mike
Commented Apr 3, 2017 at 5:59
• You are right, this seems to be quite elusive. I'll search some more later. Until then I recommend you start looking here: hog.grinvin.org/MetaDirectory.action It is easy to find such lists for undirected graphs, and also software (see geng included with nauty), but not for directed graphs. Commented Apr 3, 2017 at 8:58
• Or perhaps you can ask on math.stackexchange.com or even mathoverflow of such a list (of software to generate it) exists. If you do, please ping me as I am interested in the response too. Commented Apr 3, 2017 at 9:04

I recommend you use "gtools" from the nauty suite, specifically geng and directg. IGraph/M makes it possible (and easy) to import graphs generated by these tools.
IGImport["!geng 6 | directg", "Nauty"] // Length // AbsoluteTiming