I need ideas on how to draw the Hoffman Singleton graph in LaTeX.
-
7The question you already asked on the subject was closed because it lacks details. Indeed, posting an image and asking 'how to draw this' is not a reasonable thing to ask on this website, as is the present question. Please, provide a MWE of what you have tried so far. – KersouMan Aug 21 '20 at 14:41
-
2Does this answer your question? I need assistance with how to draw the Hoffman Singleton graph in latex – epR8GaYuh Aug 21 '20 at 18:55
2 Answers
A sagetex solution is easy because Sage knows the Hoffman Singleton graph:
\documentclass[border={2mm 2mm 8mm 8mm}]{standalone}
\usepackage{sagetex,xcolor,tikz,tkz-graph,tkz-berge}
\begin{document}
\begin{sagesilent}
g = graphs.HoffmanSingletonGraph()
g.set_pos(g.layout_circular())
g.set_latex_options(graphic_size=(20,20))
\end{sagesilent}
\begin{tikzpicture}[node distance = 10mm and 10mm]
\tikzset{EdgeStyle/.append style = {color = blue!60, line width=1pt}}
\sage{g}
\end{tikzpicture}
\end{document}
Sage is not part of the LaTeX distribution. The easiest way to access is with a free Cocalc account. Search this site for sagetex for more information. There is more explanation in my answer here.
- 12,451
In the future, please try to provide a MWE presenting a technical issue that you encountered trying to draw a given figure. Indeed, as stated in my comment, questions asking "How do I draw this?" are not reasonable questions to ask on this website. If you have difficulties with TikZ, there are a lot of resources online to help you.
Since I do not know how to use the graph library of TikZ, here is an example with foreach loops to draw and link the elements.
The drawing is based on the image provided in this question.
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\newcommand{\xoffset}{5cm}
\newcommand{\yoffset}{6cm}
\newcommand{\pentaoffset}{1.5}
\begin{document}
\begin{tikzpicture}
\foreach \x in {0,1}{
\foreach \y in {0,1,2,3,4}{
\foreach \z in {0,1,2,3,4}{
\coordinate (\x\y\z) at ($({\y*\xoffset}, {-\x*\yoffset}) + ({\z*72+90}:\pentaoffset)$);
}
}
}
\foreach \x in {0,1,2,3,4}{
\draw (0\x0) -- (0\x1) -- (0\x2) -- (0\x3) -- (0\x4) -- (0\x0);
\draw (1\x0) -- (1\x2) -- (1\x4) -- (1\x1) -- (1\x3) -- (1\x0);
\draw (0\x0) -- (0\x1) -- (0\x2) -- (0\x3) -- (0\x4) -- (0\x0);
\foreach \y in {0,1,2,3,4}{
\foreach \z in {0,1,2,3,4}{
\draw (0\x\z) -- (1\y\z);
}
}
}
\foreach \y in {0,1,2,3,4}{
\foreach \z in {0,1,2,3,4}{
\node[%
circle,
draw,
fill = white,
minimum size = 1cm
] at (0\y\z) {\y,\z};
}
}
\foreach \y in {0,1,2,3,4}{
\foreach \z in {0,1,2,3,4}{
\node[%
circle,
draw,
fill = white,
minimum size = 1cm
] at (1\y\z) {{\y}x,\z};
}
}
\end{tikzpicture}
\end{document}
which yields:
The distances in the preamble can be modified to suit the user's needs.
- 1,850
- 3
- 13
- 15

