[Tex/LaTex] LaTeX for Graph Theory

graphics

What should I use to make Graphs for Graph Theory in LaTeX?

I have seen a lot of stuff about tkz (specifically tkz-berge), but I'm running Ubuntu and there is no package for it, that I can tell. Trying to download all the .sty's is confusing the bejesus out of me. I cannot even find all the dependencies for tkz-graph.

Best Answer

This perhaps isn't quite the answer you were looking for as it isn't TeX-centric, but Graphviz has always been (for me) the tool for drawing any kind graph with more then three vertices. The ability to export to PS or PDF is a plus and there are tons of wrappers so you can use your language of choice (personally I use pydot). Graphviz shines when you have many vertices that you would like to be arranged according to some pattern (several are provided).

That being said, for small graphs (or those with a tree-like dependency), nothing can beat tikz with the iteration of TeX directly into the document, though the verbosity sometimes is off putting.

Example of a simple tikz graph code:

\begin{tikzpicture}[shorten >=1pt,->]
  \tikzstyle{vertex}=[circle,fill=black!25,minimum size=12pt,inner sep=2pt]
  \node[vertex] (G_1) at (-1,-1) {1};
  \node[vertex] (G_2) at (0,0)   {2};
  \node[vertex] (G_3) at (1,-1)  {3};
  \draw (G_1) -- (G_2) -- (G_3) -- cycle;
\end{tikzpicture}