[Tex/LaTex] find a complete list of the standard subgraphs offered by tikz

tikz-pgf

One can use subgraph I_nm and subgraph C_n, is there a complete list? In particular I'm looking for a linear subgraph, but a complete list would be extremely helpful.


I just found this in the documentation:

The library graphs.standard defines a number of such graphs, including the complete clique Kn on n nodes, the complete bipartite graph Kn,m with shores sized n and m, the cycle Cn on n nodes, the path Pn on n nodes, and the independent set In on n nodes.

Which does not appear to be a complete list, but maybe it is!

Best Answer

Are you looking for §19.10.1 Graph Macros in the manual? Here’s a list:

  • I_n      independent set
  • I_nm     two-shore independent set
  • K_n      complete clique
  • K_nm     complete bipartite graph
  • C_n      cycle
  • P_n      path
  • Grid_n   grid

If you look at the source code, however, you’ll notice this undocumented macro:

  • G_np     random (undirected) graph according to the Gn,p model (for each pair of vertices, there is an edge between them with probability p)

For example:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{graphs, graphs.standard}

\begin{document}
\tikz \graph[
    nodes={circle}, edges={gray!60, semithick}, clockwise, radius=8em,
    n=9, p=0.3
] {
    subgraph I_n; subgraph G_np
};
\end{document}

Related Question