# Something wrong to use ifthenelse and mod function in tikz

I get errors for this latex code, please someone can help me

 \documentclass{article}
\usepackage{tikz}
\usepackage{tkz-graph}
\usetikzlibrary{graphs,graphs.standard,arrows.meta}

\begin{document}

\newcount\mycount
\begin{tikzpicture}
\SetGraphUnit{2}
\renewcommand*{\VertexLineColor}{white}
\renewcommand*{\VertexLightFillColor}{red}
\renewcommand*{\VertexLineWidth}{1pt}
\GraphInit[vstyle=Welsh]
\Vertices{circle}{1,...,7}
\SetUpEdge[style={->,very thick},color=red]
\foreach \i in {1,...,7}
{
\foreach \j in {1,2,3}
{
\mycount=\i+\j
\pgfmathparse{int(Mod(\mycount,7))}
\ifthenelse{\pgfmathresult=0}
{
\Edge(\i)(\mycount)
}
{ \edef\k{\pgfmathresult}
\Edge(\i)(\k)
}
};
};
\end{tikzpicture}
\begin{document}


Indeed I want to draw a tournament named regular locally transitive tournament. Every node 'i' must related by edge with i+1, i+2, i+3 which are tested by mod function to have circular shape. Thank's in advance !

Does this do what you want?

\documentclass{article}
\usepackage{tkz-graph}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
\SetGraphUnit{2}
\renewcommand*{\VertexLineColor}{white}
\renewcommand*{\VertexLightFillColor}{red}
\renewcommand*{\VertexLineWidth}{1pt}
\GraphInit[vstyle=Welsh]
\Vertices{circle}{1,2,3,4,5,6,7} % the ... syntax doesn't work here
\SetUpEdge[style={->,very thick},color=red]
\foreach \i in {1,...,7}
{
\foreach
[evaluate=\j as \k using {ifthenelse(Mod(\i+\j,7)==0,int(\i+\j),int(Mod(\i+\j,7)))}]
\j in {1,2,3}
{
\Edge(\i)(\k)
}
}
\end{tikzpicture}
\end{document}

• Simply wath i want, thank's @Torbjorn T. But i want to known were is the wrong in my code ? – HTeX May 26 '17 at 9:15