6

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!

9

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}

|improve this answer|||||
  • That's exactly it, and it is also useful to hear they are called graph macros, thank you! – Henry Oct 22 '14 at 7:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.