[OS X TeX] Complete Graphs on n vertices

Luís Fernando Sequeira lfsequeira at gmail.com
Sun Nov 27 10:37:15 EST 2022

As promised, here is a version of the code to draw a complete graph, using tikz. 
In this complete example, it draws K28, but it works with any number of nodes.
I added an optional parameter so you can easily change the size of the drawing.

I find it quite nice, too :-)


Luís Sequeira

%!TEX TS-program = xelatex




      \foreach \i in {1,...,#2}
         \foreach \j in {1,...,#2}
            \draw (\ang*\i:#1) -- (\ang*\j:#1);


More information about the MacOSX-TeX mailing list