We can get connected undirected graphs on four vertices using
c4 = GraphData["Connected", 4];
Names and images:
Row[Column[GraphData[#, {"StandardName", "Image"}]] & /@ c4, Spacer[10]]
Define a function that gives all (non-isomorphic) directed graphs when input a list of edges:
ClearAll[dgF];
dgF[opts : OptionsPattern[]] := Module[{el = #, tpls = Tuples[{Identity, Reverse}, Length@#]},
DeleteDuplicates[Graph[MapThread[Thread[#[#2]] &, {#, el}], opts] & /@ tpls,
IsomorphicGraphQ]] &;
and set some options:
options = {VertexLabels -> Placed["Name", Center], VertexSize -> .3, ImageSize -> {200, 200},
EdgeShapeFunction->GraphElementData[{"FilledArrow", "ArrowSize"->.1, "ArrowPositions" ->.75}]};
Combining all into a function that takes an integer and options as arguments (as suggested by David):
graphsF[n_, opts : OptionsPattern[Graph]] :=
Module[{c = GraphData[#, {"Name", "Image", "EdgeRules"}] & /@ GraphData["Connected", n]},
Grid[{Rotate[Style[#1, "Panel", 14], Pi/2],Magnify[#2, .5], ## & @@ dgF[opts][#3]} & @@@ c,
Dividers -> {{True, True, {False}, True}, All}]]
graphsF[4, VertexCoordinates -> Thread[Range[4] -> Tuples[{0, 1}, 2]], ## & @@ options]
graphsF[3, VertexCoordinates -> Thread[Range[3]->{{0, 0}, {0, 1}, {1, 0}}], ## & @@ options]
UndirectedEdge
-s withDirectedEdge
-s?. $\endgroup$n
nodes is larger than the undirected graphs with the same number of nodes. Just compareShowGraph /@ ListGraphs[4,Directed];
withShowGraph /@ ListGraphs[4];
$\endgroup$GraphData
is just a database of graphs. It's not exhaustive, and it doesn't generate graphs. It just looks up the database entries. $\endgroup$