Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132948 views
License: OTHER
1
% A complete graph
2
% Author: Quintin Jean-Noël
3
% <http://moais.imag.fr/membres/jean-noel.quintin/>
4
\documentclass[varwidth=true, border=2pt]{standalone}
5
6
\usepackage{tikz}
7
\usetikzlibrary[topaths]
8
9
10
\begin{document}
11
12
% A counter, since TikZ is not clever enough (yet) to handle
13
% arbitrary angle systems.
14
\newcount\mycount
15
16
\tikzstyle{vertexs}=[draw,fill=black,circle,minimum size=4pt,inner sep=0pt]
17
18
\begin{tikzpicture}
19
%the multiplication with floats is not possible. Thus I split the loop in two.
20
\foreach \number in {1,...,8}{
21
% Computer angle:
22
\mycount=\number
23
\advance\mycount by -1
24
\multiply\mycount by 45
25
\advance\mycount by 0
26
\node[draw,circle,inner sep=0.25cm] (N-\number) at (\the\mycount:5.4cm) {};
27
}
28
\foreach \number in {9,...,16}{
29
% Computer angle:
30
\mycount=\number
31
\advance\mycount by -1
32
\multiply\mycount by 45
33
\advance\mycount by 22.5
34
\node[draw,circle,inner sep=0.25cm] (N-\number) at (\the\mycount:5.4cm) {};
35
}
36
\foreach \number in {1,...,15}{
37
\mycount=\number
38
\advance\mycount by 1
39
\foreach \numbera in {\the\mycount,...,16}{
40
\path (N-\number) edge[->,bend right=3] (N-\numbera) edge[<-,bend
41
left=3] (N-\numbera);
42
}
43
}
44
45
46
\node[draw,circle,inner sep=0.25cm,red,fill] (N-0) at (0:5.4cm) {};
47
\draw[green, ultra thick] (N-1) -- (N-2);
48
\draw[green, ultra thick] (N-1) -- (N-3);
49
\draw[green, ultra thick] (N-1) -- (N-4);
50
\draw[green, ultra thick] (N-1) -- (N-5);
51
\draw[green, ultra thick] (N-1) -- (N-6);
52
\draw[green, ultra thick] (N-1) -- (N-7);
53
\draw[green, ultra thick] (N-1) -- (N-8);
54
\draw[green, ultra thick] (N-1) -- (N-9);
55
\draw[green, ultra thick] (N-1) -- (N-10);
56
\draw[green, ultra thick] (N-1) -- (N-11);
57
\draw[green, ultra thick] (N-1) -- (N-12);
58
\draw[green, ultra thick] (N-1) -- (N-13);
59
\draw[green, ultra thick] (N-1) -- (N-14);
60
\draw[green, ultra thick] (N-1) -- (N-15);
61
\draw[green, ultra thick] (N-1) -- (N-16);
62
\end{tikzpicture}
63
\end{document}
64
65