diff options
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/tkz-berge/tkz-berge.sty | 1810 |
1 files changed, 1810 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/tkz-berge/tkz-berge.sty b/Master/texmf-dist/tex/latex/tkz-berge/tkz-berge.sty new file mode 100644 index 00000000000..60ef29b4154 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tkz-berge/tkz-berge.sty @@ -0,0 +1,1810 @@ + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % % + % tkz-berge.sty encodage : utf8 % + % % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % % + % Créé par Alain Matthes le 08-05-2007. % + % contribution : Rafael Villarroel 2007 (RV) % + % contribution : Rafael Villarroel 2009 (RV) % + % % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % modif Doyle form 1 + % add \setkeys[GR]{edge}{#1}% in edge's macros + % remove somme bugs with pgf 2.00 cvs + +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +%% Objet : Création de graphes classiques +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{tkz-berge}[2011/06/01 1.00 c tkz-berge for named graphs] + +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\RequirePackage{tkz-graph,tkz-arith} +\edef\tkzAtCode{\the\catcode`\@} +\catcode`\@=11\relax +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcounter{tkz@bg@cnt} +% NAMED GRAPHS +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> + +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% Graphes cls +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\define@cmdkey [GR] {cl} {L}{} +\define@boolkey [GR] {cl} {Math}[true]{} +\define@boolkey [GR] {cl} {inv}[true]{} +\define@cmdkey [GR] {cl} {RA}{} +\define@cmdkey [GR] {cl} {RB}{} +\define@cmdkey [GR] {cl} {RC}{} +\define@cmdkey [GR] {cl} {RD}{} +\define@cmdkey [GR] {cl} {RE}{} +\define@cmdkey [GR] {cl} {RS}{} +\define@cmdkey [GR] {cl} {prefix}{} +\define@cmdkey [GR] {cl} {prefixx}{} +\define@cmdkey [GR] {cl} {prefixxx}{} +\define@cmdkey [GR] {cl} {prefixxxx}{} +\define@cmdkey [GR] {cl} {prefixxxxx}{} +\define@cmdkey [GR] {cl} {form}{} +\define@cmdkey [GR] {cl} {num}{} +\define@cmdkey [GR] {cl} {rotation}{} +\define@cmdkey [GR] {cl} {x}{} +\define@cmdkey [GR] {cl} {y}{} +\define@cmdkey [GR] {cl} {r}{} +\define@cmdkey [GR] {cl} {d}{} +\presetkeys [GR] {cl} {RA = 4, + RB = 3, + RC = 2, + RD = 1, + RE = 0.5, + RS = 0, + form = 1, + prefix = a, + prefixx = b, + prefixxx = c, + prefixxxx = d, + prefixxxxx = e, + num = {}, + Math = false, + x = 0, + y = 0, + r = 0, + d = 0, + rotation = 0}{} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% Tools Graphes particuliers +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% Some tools +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grMathSep}{_} +\newcommand*{\grLabelSep}{;} + +\newcommand*{\write@math}[3]{% + \Vertex[x = #1,y = #2,% + L = \cmdGR@cl@prefix\grMathSep{#3}]{\cmdGR@cl@prefix#3}} +\newcommand*{\write@nomath}[3]{% + \Vertex[x = #1,y = #2]{\cmdGR@cl@prefix#3}} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% Empty graphs +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grEmptyCycle}{\@ifstar% + \grEmptyCycleStar% + \grEmptyCycleNoStar} +\newcommand*{\grEmptyCycleNoStar}[2][]{% + \begingroup% + \setkeys[GR]{cl}{#1}% + \pgfmathsetcounter{tkz@gr@p}{#2-1} + \edef\tkz@auxctp{\thetkz@gr@p} + \foreach \V@x in {0,...,\tkz@auxctp}{% + \pgfmathparse{360/#2*\V@x+\cmdGR@cl@rotation} + \let\tkz@angle\pgfmathresult% +\pgfmathsetmacro{\x@result}{% + \cmdGR@cl@RA*cos(\tkz@angle)+\cmdGR@cl@r*cos(\cmdGR@cl@d)} + \pgfmathsetmacro{\y@result}{% + \cmdGR@cl@RA*sin(\tkz@angle)+\cmdGR@cl@r*sin(\cmdGR@cl@d)} + \ifGR@cl@Math% + \presetkeys [GR] {vertex} {Math = true}{}% + \Vertex[x = \x@result+\cmdGR@cl@x,% + y = \y@result+\cmdGR@cl@y,% + L = \cmdGR@cl@prefix\grMathSep{\V@x}]{\cmdGR@cl@prefix\V@x}% + \else% + \Vertex[x = \x@result+\cmdGR@cl@x,% + y = \y@result+\cmdGR@cl@y]{\cmdGR@cl@prefix\V@x}% + \fi% + }% + \endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand{\grEmptyCycleStar}[2][]{% + \begingroup% + \setkeys[GR]{cl}{#1}% + \setcounter{tkz@gr@a}{0} + \setcounter{tkz@gr@b}{0} + \foreach \V@x in {#2}{\stepcounter{tkz@gr@b}{1}} + \foreach \V@x in {#2}{% + \pgfmathsetmacro{\x@result}{% + \cmdGR@cl@RA*cos((360/\thetkz@gr@b)*\thetkz@gr@a+\cmdGR@cl@rotation)% + +\cmdGR@cl@r*cos(\cmdGR@cl@d)% + } + \pgfmathsetmacro{\y@result}{% + \cmdGR@cl@RA*sin((360/\thetkz@gr@b)*\thetkz@gr@a+\cmdGR@cl@rotation)% + +\cmdGR@cl@r*sin(\cmdGR@cl@d)% + } + \ifGR@cl@Math% + \Vertex[% + x=\x@result+\cmdGR@cl@x, + y=\y@result+\cmdGR@cl@y, + L=$\V@x$]{\cmdGR@cl@prefix\thetkz@gr@a}% + \else% + \Vertex[% + x=\x@result+\cmdGR@cl@x, + y=\y@result+\cmdGR@cl@y, + L=\V@x]{\cmdGR@cl@prefix\thetkz@gr@a}% + \fi% + \stepcounter{tkz@gr@a}% + } + \endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grEmptyPath from (RV) +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grEmptyPath}{\@ifstar% + \grEmptyPathStar% + \grEmptyPathNoStar} +\newcommand*{\grEmptyPathNoStar}[2][]{% +\begingroup% +\setkeys[GR]{cl}{#1}% +\pgfmathsetcounter{tkz@gr@a}{#2-1} +\edef\tkz@auxctp{\thetkz@gr@a} + \ifcase\cmdGR@cl@form +\or +\def\tkzb@result{0} +\foreach \V@x in {0,...,\tkz@auxctp}{% + \pgfmathsetmacro{\x@result}{\cmdGR@cl@RA*(\V@x)*cos(\cmdGR@cl@rotation)} + \pgfmathsetmacro{\y@result}{\cmdGR@cl@RA*(\V@x)*sin(\cmdGR@cl@rotation)} + \pgfmathsetmacro{\x@coord}{\x@result+\cmdGR@cl@x+\cmdGR@cl@r*cos(\cmdGR@cl@d)} + \pgfmathsetmacro{\y@coord}{\y@result+\cmdGR@cl@y+ + \cmdGR@cl@r*sin(\cmdGR@cl@d)+\cmdGR@cl@RS} + \ifGR@cl@Math% + \presetkeys [GR] {vertex} {Math = true}{}% + \ifthenelse{\equal{\cmdGR@cl@num}{}}{% + \write@math{\x@coord}{\y@coord}{\V@x}}{% + \write@math{\x@coord}{\y@coord}{\V@x\grLabelSep\cmdGR@cl@num}}% + \else + \ifthenelse{\equal{\cmdGR@cl@num}{}}{% + \write@nomath{\x@coord}{\y@coord}{\V@x}}{% + \write@nomath{\x@coord+\cmdGR@cl@x}{\y@coord}{% + \V@x\grLabelSep\cmdGR@cl@num}}% + \fi}% + \or +\foreach \V@x in {0,...,\tkz@auxctp}{% + \pgfmathsetmacro{\x@result}{% + \cmdGR@cl@RA*(2*\V@x-\thetkz@gr@a)*0.5*cos(\cmdGR@cl@rotation)} + \pgfmathsetmacro{\y@result}{% + \cmdGR@cl@RA*(2*\V@x-\thetkz@gr@a)*0.5*sin(\cmdGR@cl@rotation)} + \pgfmathsetmacro{\x@coord}{% + \x@result+\cmdGR@cl@x+\cmdGR@cl@r*cos(\cmdGR@cl@d)} + \pgfmathsetmacro{\y@coord}{% + \y@result+\cmdGR@cl@y+\cmdGR@cl@r*sin(\cmdGR@cl@d)+\cmdGR@cl@RS} + \ifGR@cl@Math% + \presetkeys [GR] {vertex} {Math = true}{}% + \ifthenelse{\equal{\cmdGR@cl@num}{}}{% + \write@math{\x@coord}{\y@coord}{\V@x}}{% + \write@math{\x@coord}{\y@coord}{\cmdGR@cl@num\grLabelSep\V@x}}% + \else + \ifthenelse{\equal{\cmdGR@cl@num}{}}{% + \write@nomath{\x@coord}{\y@coord}{\V@x}}{% + \write@nomath{\x@coord}{\y@coord}{\cmdGR@cl@num\grLabelSep\V@x}}% + \fi +}% +\fi +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand{\grEmptyPathStar}[2][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \setcounter{tkz@gr@a}{0} + \ifcase\cmdGR@cl@form + \or + % form 1 + \foreach \V@x in {#2}{% + \pgfmathsetmacro{\x@result}{\cmdGR@cl@RA*\value{tkz@gr@a}*cos(\cmdGR@cl@rotation)% + +\cmdGR@cl@r*cos(\cmdGR@cl@d)}% + \pgfmathsetmacro{\y@result}{\cmdGR@cl@RA*\value{tkz@gr@a}*sin(\cmdGR@cl@rotation)% + +\cmdGR@cl@r*sin(\cmdGR@cl@d)}% + \ifGR@cl@Math% + \Vertex[% + x=\x@result+\cmdGR@cl@x, + y=\y@result+\cmdGR@cl@y, + L=$\V@x$]{\cmdGR@cl@prefix\thetkz@gr@a}% + \else% + \Vertex[% + x=\x@result+\cmdGR@cl@x, + y=\y@result+\cmdGR@cl@y, + L=\V@x]{\cmdGR@cl@prefix\thetkz@gr@a}% + \fi% + \stepcounter{tkz@gr@a}% + }% + \or + % form 2 + \setcounter{tkz@gr@a}{0} + \setcounter{tkz@gr@b}{0} + \foreach \V@x in {#2}{\stepcounter{tkz@gr@b}{1}} + \foreach \V@x in {#2}{% + \pgfmathsetmacro{\x@result}{\cmdGR@cl@RA*(2*\value{tkz@gr@a}-\value{tkz@gr@b}+1)*0.5% + *cos(\cmdGR@cl@rotation)% + +\cmdGR@cl@r*cos(\cmdGR@cl@d)% + } + \pgfmathsetmacro{\y@result}{\cmdGR@cl@RA*(2*\value{tkz@gr@a}-\value{tkz@gr@b}+1)*0.5% + *sin(\cmdGR@cl@rotation)% + +\cmdGR@cl@r*sin(\cmdGR@cl@d)% + } + \ifGR@cl@Math% + \Vertex[% + x=\x@result+\cmdGR@cl@x, + y=\y@result+\cmdGR@cl@y, + L=$\V@x$]{\cmdGR@cl@prefix\thetkz@gr@a}% + \else% + \Vertex[% + x=\x@result+\cmdGR@cl@x, + y=\y@result+\cmdGR@cl@y, + L=\V@x]{\cmdGR@cl@prefix\thetkz@gr@a}% + \fi% + \stepcounter{tkz@gr@a} + } + \fi + \endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grEmptyStar +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grEmptyStar}[2][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \pgfmathsetcounter{tkz@gr@a}{#2-1} + \ifGR@cl@Math\presetkeys [GR] {vertex} {Math = true}{}% + \write@math{0}{0}{\thetkz@gr@a}% + \else + \write@nomath{0}{0}{\thetkz@gr@a}% + \fi + \grEmptyCycle[#1]{\thetkz@gr@a} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grEmptyGrid +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand{\grEmptyGrid}[3][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \pgfmathsetcounter{tkz@gr@a}{#2-1} + \edef\tkz@auxctpa{\thetkz@gr@a} + \pgfmathsetcounter{tkz@gr@b}{#3-1} + \edef\tkz@auxctpb{\thetkz@gr@b} + \foreach \V@x in {0,...,\tkz@auxctpa}{% + \foreach \V@y in {0,...,\tkz@auxctpb}{% + \ifGR@cl@Math\presetkeys [GR] {vertex} {Math = true}{}% + \write@math{\cmdGR@cl@RA*\V@x}{\cmdGR@cl@RB*\V@y}{\V@x\grLabelSep\V@y}% + \else + \write@nomath{\cmdGR@cl@RA*\V@x}{\cmdGR@cl@RB*\V@y}{\V@x\grLabelSep\V@y}% + \fi}% + } +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grEmptyLadder +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grEmptyLadder}[2][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grEmptyPath[#1,RS=0]{#2} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \grEmptyPath[#1,prefix=\tkzb@ptemp,RS=\tkzb@rtemp]{#2} +\endgroup% +} + + +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% Edges +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\EdgeInGraphFromOneToComp}[4][]{% #4 +\begingroup% + \setkeys[GR]{edge}{#1}% + \pgfmathsetcounter{tkz@gr@ta}{#3-1} + \edef\tkz@auxctp{\thetkz@gr@ta} + \foreach \cx in {0,...,\tkz@auxctp}{% + \ifthenelse{\equal{\cx}{#4}}{}{\Edge[#1](#2#4)(#2\cx)}% + }% +\endgroup% +} + +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% new tool EdgeInGraphLoop loop 0--1--2.........n--0 +% star 0--1--2.........n- +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\EdgeInGraphLoop}{\@ifstar% + \EdgeInGraphLoopStar% + \EdgeInGraphLoopNoStar} +\newcommand*{\EdgeInGraphLoopNoStar}[3][]{% #4 +\begingroup% +\setkeys[GR]{edge}{#1}% + \pgfmathsetcounter{tkz@gr@ta}{#3-1} + \setcounter{tkz@gr@n}{0} + \Edge[#1](#2\thetkz@gr@ta)(#2\thetkz@gr@n) + \pgfmathaddtocounter{tkz@gr@ta}{-1} + \edef\tkz@auxctp{\thetkz@gr@ta} + \foreach \V@x in {0,...,\tkz@auxctp}{% + \stepcounter{tkz@gr@n} + \Edge[#1](#2\V@x)(#2\thetkz@gr@n)% + }% +\endgroup% +} +\newcommand*{\EdgeInGraphLoopStar}[3][]{% #4 +\begingroup% +\setkeys[GR]{edge}{#1}% + \pgfmathsetcounter{tkz@gr@ta}{#3-2} + \setcounter{tkz@gr@n}{0} + \edef\tkz@auxctp{\thetkz@gr@ta} + \foreach \V@x in {0,...,\tkz@auxctp}{% + \stepcounter{tkz@gr@n} + \Edge[#1](#2\V@x)(#2\thetkz@gr@n)% + }% +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% new tool EdgeInGraphMod replace nextmod +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\EdgeInGraphMod}{\@ifstar% + \EdgeInGraphModStar% + \EdgeInGraphModNoStar} +\newcommand*{\EdgeInGraphModNoStar}[4][]{% #2 order +\begingroup% + \setkeys[GR]{edge}{#1}% + \pgfmathsetcounter{tkz@gr@ta}{#3-1} + \edef\tkz@auxctp{\thetkz@gr@ta} + \foreach \V@x in {0,...,\tkz@auxctp}{% + \pgfmathsetcounter{tkz@gr@tb}{Mod(\V@x+#4,#3)} + \Edge[#1](#2\thetkz@gr@tb)(#2\V@x)% + }% +\endgroup% +} +%#1 prefix #2 order #3 add #4 start #5 décalage +\newcommand*{\EdgeInGraphModStar}[6][]{% +\begingroup% + \setkeys[GR]{edge}{#1}% + \pgfmathsetcounter{tkz@gr@ta}{#5} + \whiledo{\value{tkz@gr@ta}<#3}{% + \pgfmathsetcounter{tkz@gr@n}{Mod(\thetkz@gr@ta+#4,#3)} + \Edge[#1](#2\thetkz@gr@ta)(#2\thetkz@gr@n) + \pgfmathaddtocounter{tkz@gr@ta}{#6}% + }% +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% EdgeInGraphModLoop dep #4 add #3 mod #2 until #4 +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> + +\newcommand*{\EdgeInGraphModLoop}[5][]{% #2 order +\begingroup% + \setkeys[GR]{edge}{#1}% + \setcounter{tkz@gr@ta}{#5} + \setcounter{tkz@gr@n}{#3} + \whiledo{\not\equal{\value{tkz@gr@n}}{#5}}{% + \pgfmathsetcounter{tkz@gr@n}{Mod(\thetkz@gr@ta+#4,#3)} + \Edge[#1](#2\thetkz@gr@ta)(#2\thetkz@gr@n)% + \setcounter{tkz@gr@ta}{\thetkz@gr@n} + }% +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% EdgeIdentity +% la version étoilée permet d'utliser une sélection +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\EdgeIdentity}{\@ifstar% + \EdgeIdentityStar% + \EdgeIdentityNoStar} +\newcommand*{\EdgeIdentityNoStar}[4][]{% +\begingroup% + \setkeys[GR]{edge}{#1}% + \pgfmathsetcounter{tkz@gr@e}{#4-1} + \edef\tkz@auxctp{\thetkz@gr@e} + \foreach \V@x in {0,...,\tkz@auxctp}{% + \Edge[#1](#2\V@x)(#3\V@x)% + }% +\endgroup% +} +\newcommand*{\EdgeIdentityStar}[4][]{% +\begingroup% + \setkeys[GR]{edge}{#1}% + \foreach \V@x in {#4}{% + \Edge[#1](#2\V@x)(#3\V@x)% + }% +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% EdgeFromOneToAll vertex #1#3 through #2 0...#2 n-1 #5 order of the graph +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\EdgeFromOneToAll}[5][]{% #4 = order of the graph +\begingroup% + \setkeys[GR]{edge}{#1}% + \pgfmathsetcounter{tkz@gr@e}{#5-1} + \edef\tkz@auxctp{\thetkz@gr@e} + \foreach \V@x in {0,...,\tkz@auxctp}{% + \Edge[#1](#2#4)(#3\V@x)% + }% +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% EdgeFromOneToSeq vertex #1#3 through #2#4...#2#5 +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\EdgeFromOneToSeq}[6][]{% #4 +\begingroup% + \setkeys[GR]{edge}{#1}% + \foreach \V@x in {#5,...,#6}{% + \Edge[#1](#2#4)(#3\V@x)% + }% +\endgroup% +} %<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% EdgeFromOneToSel vertex #1#3 through #2#4...#2#5 +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\EdgeFromOneToSel}[5][]{% #4 +\begingroup% + \setkeys[GR]{edge}{#1}% + \foreach \V@x in {#5}{% + \Edge[#1](#2#4)(#3\V@x)% + }% +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% EdgeFromOneToComplement vertex #1#3 through #2#4...#2#5 +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\EdgeFromOneToComp}[5][]{% +\begingroup% + \setkeys[GR]{edge}{#1}% + \pgfmathsetcounter{tkz@gr@e}{#5-1} + \edef\tkz@auxctp{\thetkz@gr@e} + \foreach \cx in {0,...,\tkz@auxctp}{% + \ifthenelse{\equal{\cx}{#4}}{}{\Edge[#1](#2#4)(#3\cx)}% + }% +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% new tool EdgeMod replace nextmod +% identity with step like nextmod ??? +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\EdgeMod}{\@ifstar% + \EdgeModStar% + \EdgeModNoStar} +\newcommand*{\EdgeModNoStar}[5][]{%#3 order #4 step +\begingroup% + \setkeys[GR]{edge}{#1}% + \pgfmathsetcounter{tkz@gr@e}{#4-1} + \edef\tkz@auxctp{\thetkz@gr@e} + \foreach \V@x in {0,...,\tkz@auxctp}{% + \pgfmathsetcounter{tkz@gr@tb}{Mod(\V@x+#5,#4)} + \Edge[#1](#2\V@x)(#3\thetkz@gr@tb)% + }% +\endgroup% +} +%#1 prefix #2 prefix #3 order #4 order inf #5 step +\newcommand*{\EdgeModStar}[6][]{% +\begingroup% + \setkeys[GR]{edge}{#1}% + \setcounter{tkz@gr@ta}{0} + \whiledo{\value{tkz@gr@ta}<#4}{% + \pgfmathsetcounter{tkz@gr@tb}{Mod(\thetkz@gr@ta+#5,#4)} + \Edge[#1](#2\thetkz@gr@ta)(#3\thetkz@gr@tb)% + \pgfmathaddtocounter{tkz@gr@ta}{#6}}% +\endgroup% +}% +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% new tool EdgeInGraphSeq sequence i--i+1--.....--j +% or i--i+k--...--j +% #1 options #2 graph #3 from #4 to +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\EdgeInGraphSeq}[4][]{% #4 +\begingroup% +\setkeys[GR]{edge}{#1}% + \foreach \V@x in {#3,...,#4}{% + \pgfmathsetcounter{tkz@gr@n}{\V@x+1} + \Edge[#1](#2\V@x)(#2\thetkz@gr@n)}% +\endgroup% +}% + +%%%%%%%%%%% NEW COMMANDS +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% new tool EdgeSeq sequence +% #1 options #2 first graph #3 second graph #4 from #5 to +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand{\EdgeSequence}[5][]{% +\begingroup% +\setkeys[GR]{edge}{#1}% + \foreach \V@x in {#4,...,#5}{% + \pgfmathsetcounter{tkz@gr@n}{\V@x+1} + \Edge[#1](#2\V@x)(#3\thetkz@gr@n)}% +\endgroup% +}% +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% EdgeDoubleMod by RV +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\EdgeDoubleMod}[9]{% +\begingroup% + \foreach \V@x in {0,...,#9}{% + \pgfmathsetcounter{tkz@gr@c}{Mod(#3+(#4*\V@x),#2)} + \pgfmathsetcounter{tkz@gr@n}{Mod(#7+(#8*\V@x),#6)} + \Edge(#1\thetkz@gr@c)(#5\thetkz@gr@n) + }% +\endgroup% +} + +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grPath +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grPath}[2][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grEmptyPath[#1]{#2} + \ifthenelse{\equal{\cmdGR@cl@num}{}}{% + \ifthenelse{\equal{#2}{1}}{}{% + \EdgeInGraphLoop*{\cmdGR@cl@prefix}{#2}% + }}{% + \ifthenelse{\equal{#2}{1}}{}{% + \ifcase\cmdGR@cl@form + \or + \pgfmathsetcounter{tkz@gr@ta}{#2-2} + \setcounter{tkz@gr@n}{0} + \edef\tkz@auxctp{\thetkz@gr@ta} + \foreach \V@x in {0,...,\tkz@auxctp}{% + \stepcounter{tkz@gr@n} + \Edge(\cmdGR@cl@prefix\V@x\grLabelSep\cmdGR@cl@num)% + (\cmdGR@cl@prefix\thetkz@gr@n\grLabelSep\cmdGR@cl@num)% + }% + \or + \EdgeInGraphLoop*{\cmdGR@cl@prefix\cmdGR@cl@num\grLabelSep}{#2} + \fi% + }} +\endgroup% +} + +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grGrid +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grGrid}[3][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grEmptyGrid[#1]{#2}{#3} + \pgfmathsetcounter{tkz@gr@a}{#2-2} + \edef\tkz@auxctpa{\thetkz@gr@a} + \pgfmathsetcounter{tkz@gr@b}{#3-2} + \edef\tkz@auxctpb{\thetkz@gr@b} + \foreach \V@x in {0,...,\tkz@auxctpa}{% + \foreach \V@y in {0,...,\tkz@auxctpb}{% + \pgfmathsetcounter{tkz@gr@c}{\V@x+1} + \pgfmathsetcounter{tkz@gr@d}{\V@y+1} + \Edge(\cmdGR@cl@prefix\V@x\grLabelSep\V@y)% + (\cmdGR@cl@prefix\V@x\grLabelSep\thetkz@gr@d) + \Edge(\cmdGR@cl@prefix\V@x\grLabelSep\V@y)% + (\cmdGR@cl@prefix\thetkz@gr@c\grLabelSep\V@y)% + }% + }% + \pgfmathsetcounter{tkz@gr@a}{#2-2} + \pgfmathsetcounter{tkz@gr@b}{#3-1} + \edef\tkz@auxctpa{\thetkz@gr@a} + \foreach \V@x in {0,...,\tkz@auxctpa}{% + \pgfmathsetcounter{tkz@gr@c}{\V@x+1} + \Edge(\cmdGR@cl@prefix\V@x\grLabelSep\thetkz@gr@b)% + (\cmdGR@cl@prefix\thetkz@gr@c\grLabelSep\thetkz@gr@b)% + }% + \pgfmathsetcounter{tkz@gr@a}{#2-1} + \pgfmathsetcounter{tkz@gr@b}{#3-2} + \edef\tkz@auxctpb{\thetkz@gr@b} + \foreach \V@y in {0,...,\tkz@auxctpb}{% + \pgfmathsetcounter{tkz@gr@d}{\V@y+1} + \Edge(\cmdGR@cl@prefix\thetkz@gr@a\grLabelSep\V@y)% + (\cmdGR@cl@prefix\thetkz@gr@a\grLabelSep\thetkz@gr@d)% + }% +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grComplete +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grComplete}[2][]{% #1 options #2 ordre du graphe +\begingroup% + \setkeys[GR]{cl}{#1}% + \grEmptyCycle[#1]{#2}% + \pgfmathsetcounter{tkz@gr@a}{#2-1} + \edef\tkz@auxctp{\thetkz@gr@a} + \foreach \ia in {0,...,\tkz@auxctp}% + {\foreach \ib in {\ia,...,\tkz@auxctp} + {\Edge(\cmdGR@cl@prefix\ia)(\cmdGR@cl@prefix\ib)}% + }% +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grCycle +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grCycle}[2][]{% +\begingroup% + \setkeys[GR]{cl}{#1} + \grEmptyCycle[#1]{#2} + \EdgeInGraphLoop{\cmdGR@cl@prefix}{#2} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grLCF +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand{\grLCF}[3][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \setcounter{tkz@gr@a}{#3} + \setcounter{tkz@gr@b}{0} + \foreach \V@x in {#2}{\stepcounter{tkz@gr@b}} + \pgfmathsetcounter{tkz@gr@c}{\thetkz@gr@a * \thetkz@gr@b} + \setcounter{tkz@gr@b}{\thetkz@gr@c} + \grCycle[#1]{\thetkz@gr@c} +%<––––––––––––––––––––––––– End Vertex ––––––––––––––––––––––––––––––––––––> + \pgfmathsetcounter{tkz@gr@a}{#3-1} + \edef\tkz@auxctp{\thetkz@gr@a} + \setcounter{tkz@gr@e}{0} + \foreach \V@k in {0,...,\tkz@auxctp}{% + \foreach \n in {#2}{% + \ifthenelse{\n < 0}{% + \pgfmathsetcounter{tkz@gr@b}{\n+\thetkz@gr@c}}{% + \pgfmathsetcounter{tkz@gr@b}{\n}} + \pgfmathsetcounter{tkz@gr@n}% + {Mod(\thetkz@gr@e+\thetkz@gr@b,\thetkz@gr@c)} + \Edge(\cmdGR@cl@prefix\thetkz@gr@e)(\cmdGR@cl@prefix\thetkz@gr@n) + \stepcounter{tkz@gr@e}% + }% + }% +\endgroup% +} + +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grStar +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grStar}[2][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grEmptyStar[#1]{#2} + \pgfmathsetcounter{tkz@gr@p}{#2-1} + \EdgeInGraphFromOneToComp{\cmdGR@cl@prefix}{#2}{\thetkz@gr@p} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grWheel +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grWheel}[2][]{ +\begingroup% + \setkeys[GR]{cl}{#1}% + \grStar[#1]{#2} + \pgfmathsetcounter{tkz@gr@e}{#2-1} + \EdgeInGraphLoop{\cmdGR@cl@prefix}{\thetkz@gr@e} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grSQCircle +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grSQCycle}[2][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grCycle[#1]{#2}% + \EdgeInGraphMod{\cmdGR@cl@prefix}{#2}{2} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grLadder +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grLadder}[2][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grPath[#1,RS=0]{#2}{0} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \edef\tkzb@rtemp{\cmdGR@cl@RS} + \grPath[#1,prefix=\tkzb@ptemp,RS=\tkzb@rtemp]{#2} + \EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{#2} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grPrism +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grPrism}[2][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grCycle[#1]{#2} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \grCycle[#1,RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{#2} + \EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{#2} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grCompleteBipartite +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grCompleteBipartite}[3][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \pgfmathsetcounter{tkz@gr@a}{#2-1} + \pgfmathparse{(\cmdGR@cl@RA * \thetkz@gr@a) /2} + \let\tkzRAxpos\pgfmathresult% + \pgfmathsetcounter{tkz@gr@a}{#3-1} + \pgfmathparse{(\cmdGR@cl@RB * \thetkz@gr@a) /2} + \let\tkzRBxpos\pgfmathresult% + \ifdim\tkzRBxpos pt > \tkzRAxpos pt\relax% + \pgfmathadd{\tkzRBxpos}{-\tkzRAxpos} + \let\tkzaxpos\pgfmathresult% + \def\tkzbxpos{0} + \else% + \pgfmathadd{\tkzRAxpos}{-\tkzRBxpos} + \let\tkzbxpos\pgfmathresult% + \def\tkzaxpos{0} + \fi% + \begin{scope}[xshift=\tkzaxpos cm] + \grEmptyPath[#1,RS=0]{#2} + \end{scope} + \begin{scope}[xshift=\tkzbxpos cm] + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \edef\tkzb@rtemp{\cmdGR@cl@RS} + \edef\tkzb@stemp{\cmdGR@cl@RB} + \grEmptyPath[#1,RA=\tkzb@stemp,prefix=\tkzb@ptemp,RS=\tkzb@rtemp]{#3} + \end{scope} + \pgfmathsetcounter{tkz@gr@p}{#2-1} + \pgfmathsetcounter{tkz@gr@e}{#3-1} + \edef\tkz@auxctp{\thetkz@gr@e} + \foreach \cpx in {0,...,\tkz@auxctp}{% + \EdgeFromOneToAll{\cmdGR@cl@prefixx}{\cmdGR@cl@prefix}{\cpx}{#2} + }% +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grTriangularGrid +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grTriangularGrid}[2][]{% +\begingroup% + \setkeys[GR]{cl}{#1} + \ifcase\cmdGR@cl@form + \or +%<––––––––––––––––––––– form 1 equilateral triangle ––––––––––––––––––––––––> + \pgfmathsetcounter{tkz@gr@a}{#2-1} + %\pgfmathsetcounter{tkz@gr@b}{#2} + \edef\tkz@auxctp{\thetkz@gr@a} + \foreach \lg in {0,...,\tkz@auxctp}{% + \pgfmathsetcounter{tkz@gr@b}{#2-\lg} + \setcounter{tkz@gr@b}{\thetkz@gr@b} + \edef\tkzb@rtemp{\cmdGR@cl@RA} + \edef\tkzb@ptemp{\cmdGR@cl@prefix} + \pgfmathmultiply{\cmdGR@cl@RA}{\lg} + \let\myresult\pgfmathresult + \pgfmathparse{\cmdGR@cl@RA*\lg/2} + \let\tkzaxpos\pgfmathresult + \begin{scope}[xshift=\tkzaxpos cm] + \grPath[#1,% + RA = \tkzb@rtemp,% + RS = \myresult,% + prefix = \tkzb@ptemp,% + num = \lg]{\thetkz@gr@b}% + \end{scope}% + } + \or +%<––––––––––––––––––––––––––– form 2 right triangle ––––––––––––––––––––––––> + \pgfmathsetcounter{tkz@gr@a}{#2-1} + % \pgfmathsetcounter{tkz@gr@b}{#2} + \edef\tkz@auxctp{\thetkz@gr@a} + \foreach \lg in {0,...,\tkz@auxctp}{% + \pgfmathsetcounter{tkz@gr@b}{#2-\lg} + \setcounter{tkz@gr@b}{\thetkz@gr@b} + \edef\tkzb@rtemp{\cmdGR@cl@RA} + \edef\tkzb@ptemp{\cmdGR@cl@prefix} + \pgfmathmultiply{\cmdGR@cl@RA}{\lg} + \let\myresult\pgfmathresult + \grPath[#1,% + RA = \tkzb@rtemp,% + RS = \myresult,% + prefix = \tkzb@ptemp,% + num = \lg,form=1]{\thetkz@gr@b}% + } + \or + \pgfmathsetcounter{tkz@gr@a}{#2-1} + \pgfmathsetcounter{tkz@gr@b}{#2} + \edef\tkz@auxctp{\thetkz@gr@a} + \foreach \lg in {0,...,\tkz@auxctp}{% + \pgfmathsetcounter{tkz@gr@b}{#2-\lg} + \setcounter{tkz@gr@b}{\thetkz@gr@b} + \edef\tkzb@rtemp{\cmdGR@cl@RA} + \edef\tkzb@ptemp{\cmdGR@cl@prefix} + \pgfmathmultiply{\cmdGR@cl@RA}{\lg} + \let\myresult\pgfmathresult + \begin{scope}[xshift=\myresult cm] + \grPath[#1,% + RA = \tkzb@rtemp,% + RS = \myresult,% + prefix = \tkzb@ptemp,% + num = \lg,form=1]{\thetkz@gr@b}% + \end{scope}% + } + \fi% + \pgfmathsetcounter{tkz@gr@a}{#2-2} + \edef\tkz@auxctp{\thetkz@gr@a} + \foreach \V@x in {0,...,\tkz@auxctp}{% + \pgfmathsetcounter{tkz@gr@e}{\thetkz@gr@a-\V@x} + \edef\tkz@auxctpb{\thetkz@gr@e} + \foreach \V@y in {0,...,\tkz@auxctpb}{% + \pgfmathsetcounter{tkz@gr@b}{\V@y+1} + \Edge(\cmdGR@cl@prefix\V@x\grLabelSep\V@y)% + (\cmdGR@cl@prefix\V@x\grLabelSep\thetkz@gr@b) + \pgfmathsetcounter{tkz@gr@p}{\V@x+1} + \Edge(\cmdGR@cl@prefix\V@x\grLabelSep\thetkz@gr@b)% + (\cmdGR@cl@prefix\thetkz@gr@p\grLabelSep\V@y) + }% + } +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grHeawood +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grHeawood}[1][]{% #1 options #2 ordre du graphe +\begingroup% + \setkeys[GR]{cl}{#1}% + \grCycle[#1]{14} + \EdgeInGraphMod*{\cmdGR@cl@prefix}{14}{5}{0}{2} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grCirculant #1 option #2 vertex #3 add k +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grCirculant}[3][]{% +\begingroup% + \setkeys[GR]{cl}{#1} + \grEmptyCycle[#1]{#2}% + \pgfmathisprime{#2}% + \ifnum\pgfmathresult=1\relax + \foreach \kci in {#3}{% + \EdgeInGraphMod{\cmdGR@cl@prefix}{#2}{\kci}}% + \else + \foreach \kci in {#3}{% + \pgfmathisfactor{#2}{\kci}% + \ifnum\pgfmathresult=1\relax + \pgfmathsetcounter{tkz@gr@a}{\kci-1} + \edef\tkz@auxctp{\thetkz@gr@a} + \foreach \start in {0,...,\tkz@auxctp}{% + \setcounter{tkz@gr@i}{\start}% + \setcounter{tkz@gr@n}{#2}% + \whiledo{\not\equal{\value{tkz@gr@n}}{\start}}{% + \pgfmathsetcounter{tkz@gr@n}{Mod(\thetkz@gr@i+\kci,#2)} + \Edge(\cmdGR@cl@prefix\thetkz@gr@i)% + (\cmdGR@cl@prefix\thetkz@gr@n)% + \pgfmathsetcounter{tkz@gr@i}{\thetkz@gr@n}% + }% + }% + \else + \EdgeInGraphMod{\cmdGR@cl@prefix}{#2}{\kci} + \fi + }% + \fi +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grPetersenG +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grGeneralizedPetersen}[3][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grCycle[#1]{#2} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \edef\tkzb@pptemp{\cmdGR@cl@prefixx} + \edef\tkzb@ptemp{\cmdGR@cl@prefix} + \grCirculant[#1,RA=\tkzb@rtemp,prefix=\tkzb@pptemp]{#2}{#3} + \EdgeIdentity{\tkzb@ptemp}{\cmdGR@cl@prefixx}{#2} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grPetersen +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grStartwo}[2][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \pgfmathsetcounter{tkz@gr@e}{3*#2-2} + \pgfmathsetcounter{tkz@gr@a}{3*#2-1} + \grEmptyCycle[#1]{\thetkz@gr@a} + \EdgeInGraphMod{\cmdGR@cl@prefix}{\thetkz@gr@a}{#2}% +\endgroup% +} + +\newcommand*{\grPetersen}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \ifcase\cmdGR@cl@form + \or + \grCycle[#1]{5}% + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \grStartwo[#1,RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{2} + \EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{5} + \or + \grCycle[#1]{6} + \begin{scope}[rotate=30] + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \grStar[#1,RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{4} + \end{scope} + \setcounter{tkz@gr@a}{2} + \foreach \V@x in {0,...,5}{% + \ifthenelse{\equal{\thetkz@gr@a}{-1}}{% + \setcounter{tkz@gr@a}{2}}{% + }% + \Edge(\cmdGR@cl@prefix\V@x)(\cmdGR@cl@prefixx\thetkz@gr@a) + \addtocounter{tkz@gr@a}{-1}% + }% + \or + \grEmptyStar[#1]{10} + \EdgeInGraphLoop{\cmdGR@cl@prefix}{9} + \EdgeInGraphMod*{\cmdGR@cl@prefix}{9}{4}{0}{3} + \foreach \V@x in {2,5,8}{% + \Edge(\cmdGR@cl@prefix\V@x)(\cmdGR@cl@prefix 9)}% + \fi +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grPlatonic +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grTetrahedral}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \begin{scope}[rotate=90] + \grWheel[#1]{4}% + \end{scope} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grOctahedral +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grOctahedral}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grComplete[#1]{3}% + \begin{scope}[rotate=-60] + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \grComplete[#1,RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{3}% + \end{scope} + \EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{3} + \EdgeMod{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{3}{1} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grCubicalGraph +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grCubicalGraph}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grCycle[#1]{4} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \grCycle[#1,RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{4} + \ifcase\cmdGR@cl@form + \or + \EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{4} + \or + \EdgeMod*{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{4}{1}{2} + \EdgeMod*{\cmdGR@cl@prefixx}{\cmdGR@cl@prefix}{4}{1}{2} + \fi +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grIcosahedral +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grIcosahedral}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \ifcase\cmdGR@cl@form + \or + \grCycle[#1]{6}% + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \grCirculant[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{6}{2} + \EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{6} + \EdgeMod{\cmdGR@cl@prefixx}{\cmdGR@cl@prefix}{6}{1} + \EdgeMod{\cmdGR@cl@prefixx}{\cmdGR@cl@prefix}{6}{-1} + \or + \grCycle[#1]{3} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \grCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{6}% + \begin{scope}[rotate=60] + \edef\tkzb@rtemp{\cmdGR@cl@RC} + \edef\tkzb@ptemp{\cmdGR@cl@prefixxx} + \grCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{3}% + \end{scope} + \setcounter{tkz@gr@a}{2} + \foreach \st in {5,0,1}{% + \foreach \v in {0,1,2}{% + \pgfmathsetcounter{tkz@gr@n}{Mod((\thetkz@gr@a*\v)+\st,6)}% + \Edge(\cmdGR@cl@prefix\v)(\cmdGR@cl@prefixx\thetkz@gr@n) + }% + }% + \setcounter{tkz@gr@a}{2} + \foreach \v in {0,1,2}{% + \foreach \st in {0,1,2}{% + \pgfmathsetcounter{tkz@gr@n}{Mod(\thetkz@gr@a*\v+\st,6)}% + \Edge(\cmdGR@cl@prefixxx\v)(\cmdGR@cl@prefixx\thetkz@gr@n) + }% + }% + \fi +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grDodecahedral +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grDodecahedral}[1][]{% +\begingroup% +\setkeys[GR]{cl}{#1}% + \ifcase\cmdGR@cl@form + \or + \grCycle[#1]{10} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \grCirculant[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{10}{2} + \EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{10} + \or + \grCycle[#1]{5} + \begin{scope}[rotate=36] + \edef\tkzb@rtemp{\cmdGR@cl@RC} + \edef\tkzb@ptemp{\cmdGR@cl@prefixxx} + \grEmptyCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{5} + \end{scope} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \grEmptyCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{5} + \begin{scope}[rotate=36] + \edef\tkzb@rtemp{\cmdGR@cl@RD} + \edef\tkzb@ptemp{\cmdGR@cl@prefixxxx} + \grCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{5}% + \end{scope} + \EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{5} + \EdgeIdentity{\cmdGR@cl@prefixxx}{\cmdGR@cl@prefixxxx}{5} + \EdgeIdentity{\cmdGR@cl@prefixx}{\cmdGR@cl@prefixxx}{5} + \EdgeMod{\cmdGR@cl@prefixx}{\cmdGR@cl@prefixxx}{5}{-1} + \or + \grCycle[#1]{5} + \begin{scope}[rotate=36] + \edef\tkzb@rtemp{\cmdGR@cl@RC} + \edef\tkzb@ptemp{\cmdGR@cl@prefixxx} + \grEmptyCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{5} + \end{scope} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \grCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{10} + \EdgeInGraphLoop{\cmdGR@cl@prefixxx}{5} + \EdgeDoubleMod{\cmdGR@cl@prefix}{5}{0}{1}% + {\cmdGR@cl@prefixx}{10}{0}{2}{5} + \EdgeDoubleMod{\cmdGR@cl@prefixxx}{5}{0}{1}% + {\cmdGR@cl@prefixx}{10}{1}{2}{5} + \or + \grLCF[#1]{10,7,4,-4,-7,10,-4,7,-7,4}{2} + \or + \grCycle[#1]{10} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \grEmptyCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{6} + \begin{scope}[rotate=45] + \edef\tkzb@rtemp{\cmdGR@cl@RC} + \edef\tkzb@ptemp{\cmdGR@cl@prefixxx} + \grEmptyCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{4}% + \end{scope} + \setcounter{tkz@gr@a}{0} + \foreach \v in {1,4,6,9}{% + \Edge(\cmdGR@cl@prefix\v)(\cmdGR@cl@prefixxx\thetkz@gr@a) + \stepcounter{tkz@gr@a} + }% + \setcounter{tkz@gr@a}{0} + \foreach \v in {2,1,5,4}{% + \Edge(\cmdGR@cl@prefixx\v)(\cmdGR@cl@prefixxx\thetkz@gr@a) + \stepcounter{tkz@gr@a} + }% + \setcounter{tkz@gr@a}{0} + \foreach \v in {0,2,3,5,7,8}{% + \Edge(\cmdGR@cl@prefix\v)(\cmdGR@cl@prefixx\thetkz@gr@a) + \stepcounter{tkz@gr@a} + }% + \Edge(\cmdGR@cl@prefixxx0)(\cmdGR@cl@prefixxx3) + \Edge(\cmdGR@cl@prefixxx1)(\cmdGR@cl@prefixxx2) + \Edge(\cmdGR@cl@prefixx0)(\cmdGR@cl@prefixx1) + \Edge(\cmdGR@cl@prefixx0)(\cmdGR@cl@prefixx5) + \Edge(\cmdGR@cl@prefixx3)(\cmdGR@cl@prefixx2) + \Edge(\cmdGR@cl@prefixx3)(\cmdGR@cl@prefixx4) +\fi +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grMobiusKantor +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grMobiusKantor}[1][]{% #1 options #2 ordre du graphe +\begingroup% + \setkeys[GR]{cl}{#1} + \ifcase\cmdGR@cl@form + \or + \grCycle[#1]{16} + \EdgeInGraphMod*{\cmdGR@cl@prefix}{16}{5}{0}{2} + \or + \grCycle[#1]{8} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \grCirculant[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{8}{3} + \EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{8} + \or + \grCirculant[#1]{8}{3} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \grCycle[#1,RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{8} + \EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{8} + \fi +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grMoebiusLadder +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grMobiusLadder}[2][]{% +\begingroup% + \setkeys[GR]{cl}{#1} + \grEmptyCycle[#1]{#2} + \pgfmathsetcounter{tkz@gr@p}{#2-1} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \grEmptyCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{#2}% + \EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{#2} + \EdgeInGraphLoop*{\cmdGR@cl@prefix}{#2} + \EdgeInGraphLoop*{\cmdGR@cl@prefixx}{#2} + \Edge(\cmdGR@cl@prefix0)(\cmdGR@cl@prefixx\thetkz@gr@p) + \Edge(\cmdGR@cl@prefixx0)(\cmdGR@cl@prefix\thetkz@gr@p) +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grCocktailParty +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grCocktailParty}[2][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \pgfmathsetcounter{tkz@gr@p}{#2-1} + \grPath[#1,RS=0]{#2} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \edef\tkzb@rtemp{\cmdGR@cl@RS} + \grPath[#1,prefix=\tkzb@ptemp,RS=\tkzb@rtemp]{#2} + \edef\tkz@auxctp{\thetkz@gr@p} + \foreach \cpx in {0,...,\tkz@auxctp}{% + \EdgeFromOneToComp{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{\cpx}{#2} + } +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grCrown +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grCrown}[2][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \pgfmathsetcounter{tkz@gr@p}{#2-1} + \grEmptyPath[#1,RS=0]{#2} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \edef\tkzb@rtemp{\cmdGR@cl@RS} + \grEmptyPath[#1,prefix=\tkzb@ptemp,RS=\tkzb@rtemp]{#2} + \edef\tkz@auxctp{\thetkz@gr@p} + \foreach \cpx in {0,...,\thetkz@gr@p}{% + \EdgeFromOneToComp{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{\cpx}{#2} + } +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grMcGee +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grMcGee}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grLCF[#1]{-12,7,-7}{8} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grRobertson +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grRobertson}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grLCF[#1]{8,4,7,4,8,5,7,4,7,8,4,5,7,8,4,8,4,8,4}{1} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grRobertsonWegner +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grRobertsonWegner}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grLCF[#1]{6,12}{15} + \EdgeInGraphMod{\cmdGR@cl@prefix}{30}{9}{1}{6} + \EdgeInGraphMod*{\cmdGR@cl@prefix}{30}{15}{2}{6} + \EdgeInGraphMod*{\cmdGR@cl@prefix}{30}{9}{3}{6} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grDoyle +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grDoyle}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \ifcase\cmdGR@cl@form + \or + \grCycle[#1]{9} + \begin{scope}[rotate=18] + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \grCirculant[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{9}{2} + \end{scope} + \EdgeMod{\cmdGR@cl@prefixx}{\cmdGR@cl@prefix}{9}{1} + \edef\tkzb@ptemp{\cmdGR@cl@prefixxx} + \edef\tkzb@rtemp{\cmdGR@cl@RC} + \grCirculant[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{9}{4} + \EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixxx}{9} + \EdgeMod{\cmdGR@cl@prefixx}{\cmdGR@cl@prefixxx}{9}{1} + \or + \grCycle[#1]{27} + \EdgeDoubleMod{\cmdGR@cl@prefix}{27}{0}{3} + {\cmdGR@cl@prefix}{27}{13}{3}{9} + \EdgeDoubleMod{\cmdGR@cl@prefix}{27}{1}{3} + {\cmdGR@cl@prefix}{27}{5}{3}{9} + \EdgeDoubleMod{\cmdGR@cl@prefix}{27}{0}{3} + {\cmdGR@cl@prefix}{27}{20}{3}{9} + \or + \grCycle[#1]{27} + \EdgeDoubleMod{\cmdGR@cl@prefix}{27}{17}{1} + {\cmdGR@cl@prefix}{27}{10}{-2}{4} + \EdgeDoubleMod{\cmdGR@cl@prefix}{27}{26}{1} + {\cmdGR@cl@prefix}{27}{19}{-2}{4} + \EdgeDoubleMod{\cmdGR@cl@prefix}{27}{8}{1} + {\cmdGR@cl@prefix}{27}{1}{-2}{4} + \EdgeDoubleMod{\cmdGR@cl@prefix}{27}{4}{1} + {\cmdGR@cl@prefix}{27}{27}{-2}{3} + \EdgeDoubleMod{\cmdGR@cl@prefix}{27}{8}{1} + {\cmdGR@cl@prefix}{27}{1}{-2}{4} + \EdgeDoubleMod{\cmdGR@cl@prefix}{27}{14}{1} + {\cmdGR@cl@prefix}{27}{7}{-2}{2} + \EdgeDoubleMod{\cmdGR@cl@prefix}{27}{23}{1} + {\cmdGR@cl@prefix}{27}{16}{-2}{2} + \Edge(\cmdGR@cl@prefix9)(\cmdGR@cl@prefix13)% + \Edge(\cmdGR@cl@prefix18)(\cmdGR@cl@prefix22)% + \fi +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grDesargues +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grDesargues}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \ifcase\cmdGR@cl@form + \or + \grLCF[#1]{5,-5,9,-9}{5} + \or + \grGeneralizedPetersen[#1]{10}{3} + \fi +\endgroup% +} + +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grKonisberg +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% #1 prefix #2 indice #2 prefix #3 indice choisie entre #4 et #5 ... +\newcommand{\grKonisberg}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grCycle[#1]{4} + \Edge[style={bend left}](\cmdGR@cl@prefix1)(\cmdGR@cl@prefix2) + \Edge[style={bend left}](\cmdGR@cl@prefix2)(\cmdGR@cl@prefix3) + \Edge(\cmdGR@cl@prefix0)(\cmdGR@cl@prefix2) +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grWong +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> + +\newcommand{\grWong}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grLCF[#1]{8,4,12,4,8,4}{5} + \EdgeInGraphMod*{\cmdGR@cl@prefix}{30}{15}{0}{3} + \EdgeInGraphMod*{\cmdGR@cl@prefix}{30}{16}{1}{6} + \EdgeInGraphMod*{\cmdGR@cl@prefix}{30}{18}{4}{6} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grTutte +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> + +\newcommand{\grTutteCoxeter}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grLCF[#1]{-13,-9,7,-7,9,13}{5} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grFoster +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> + +\newcommand{\grFoster}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grLCF[#1]{17,-9,37,-37,9,-17}{15} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grFolkman +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> + +\newcommand{\grFolkman}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grLCF[#1]{5,-7,-7,5}{5} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grFranklin +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> + +\newcommand{\grFranklin}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grLCF[#1]{5,-5}{6} +\endgroup% +} + +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grNauru +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> + +\newcommand{\grNauru}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grLCF[#1]{5, −9, 7, −7, 9, −5}{4} +\endgroup% +} + +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grDick +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> + +\newcommand{\grDick}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grLCF[#1]{5,-5,13,-13}{8} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grHarries +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> + +\newcommand{\grHarries}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \grLCF[#1]{-29,-19,-13,13,21,-27,27,33,-13,13,19,-21,-33,29}{5} +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grAndrasfai +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcounter{tkza@tmp} + \newcommand*{\grAndrasfai}[2][]{% + \begingroup + \setkeys[GR]{cl}{#1}% + \pgfmathsetcounter{tkz@bg@cnt}{3*#2-1} + \grEmptyCycle[#1]{\thetkz@bg@cnt} + \pgfmathsetcounter{tkza@tmp}{\thetkz@bg@cnt/2} + \pgfmathsetcounter{tkza@tmp}{\thetkz@bg@cnt+1} + \pgfmathsetcounter{tkz@gr@p}{1} + \whiledo{\value{tkz@gr@p} < \value{tkza@tmp}}{% + \EdgeInGraphMod*{\cmdGR@cl@prefix}{\thetkz@bg@cnt}{\thetkz@gr@p}{0}{1} + \pgfmathsetcounter{tkz@gr@p}{\thetkz@gr@p+3} + } +\endgroup +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grGrotzsch +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grGrotzsch}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \ifcase\cmdGR@cl@form + \or + \begin{scope}[rotate=18]% + \grStar[#1]{6}% + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \grCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{5}% + \Edges(\cmdGR@cl@prefix0,\cmdGR@cl@prefixx1,% + \cmdGR@cl@prefix2,\cmdGR@cl@prefixx3,% + \cmdGR@cl@prefix4,\cmdGR@cl@prefixx0,% + \cmdGR@cl@prefix1,\cmdGR@cl@prefixx2,% + \cmdGR@cl@prefix3,\cmdGR@cl@prefixx4,\cmdGR@cl@prefix0) + \end{scope} + \or + \begin{scope}[rotate=18]% + \grStar[#1]{6}% + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \begin{scope}[rotate=-36]% + \grCirculant[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{5}{2}% + \end{scope} + \EdgeDoubleMod{a}{5}{0}{1}% + {b}{5}{1}{1}{4} + \EdgeIdentity{a}{b}{5} + \end{scope} +\fi +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grLevi +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grLevi}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \ifcase\cmdGR@cl@form + \or + \grLCF[#1]{-13,-9,7,-7,9,13}{5} + \or + \grCycle[#1]{10} + \EdgeInGraphMod{\cmdGR@cl@prefix}{10}{5} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{10} + \edef\tkzb@ptemp{\cmdGR@cl@prefixxx} + \edef\tkzb@rtemp{\cmdGR@cl@RC} + \grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{10} + \EdgeInGraphMod{\cmdGR@cl@prefixxx}{10}{4} +\fi +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grPappus +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grPappus}[1][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \ifcase\cmdGR@cl@form +\or + \grLCF[#1]{5,7,-7,7,-7,-5}{3} +\or + \begin{scope}[rotate=30]% + \grCycle[#1]{6} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \grCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{6} + \edef\tkzb@ptemp{\cmdGR@cl@prefixxx} + \edef\tkzb@rtemp{\cmdGR@cl@RC} + \grCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{6} + \EdgeDoubleMod{\cmdGR@cl@prefixxx}{6}{0}{2}% + {\cmdGR@cl@prefixx}{6}{5}{2}{2} + \EdgeDoubleMod{\cmdGR@cl@prefixxx}{6}{5}{2}% + {\cmdGR@cl@prefix}{6}{1}{2}{2} + \EdgeDoubleMod{\cmdGR@cl@prefixx}{6}{0}{2}% + {\cmdGR@cl@prefix}{6}{0}{2}{2} +\end{scope} +\or + \begin{scope}[rotate=30] + \grCycle[#1]{6} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \grCirculant[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{6}{2} + \edef\tkzb@ptemp{\cmdGR@cl@prefixxx} + \edef\tkzb@rtemp{\cmdGR@cl@RC} + \grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{6} + \EdgeIdentity{\cmdGR@cl@prefixx}{\cmdGR@cl@prefix}{6} + \EdgeInGraphMod{\cmdGR@cl@prefixxx}{6}{3} +\end{scope} +\fi +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grChvatal +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grChvatal}[1][]{% +\begingroup% +\setkeys[GR]{cl}{#1}% +\ifcase\cmdGR@cl@form +\or + \begin{scope}[rotate=45] + \grCycle[#1]{4} + \end{scope} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \begin{scope}[rotate=22.25] + \grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{8} + \end{scope} + \EdgeInGraphMod{\cmdGR@cl@prefixx}{8}{4} + \EdgeInGraphMod*{\cmdGR@cl@prefixx}{8}{1}{1}{2} + \EdgeInGraphMod*{\cmdGR@cl@prefixx}{8}{3}{1}{2} + \EdgeDoubleMod{\cmdGR@cl@prefix}{4}{0}{1}% + {\cmdGR@cl@prefixx}{8}{1}{2}{3} + \EdgeDoubleMod{\cmdGR@cl@prefix}{4}{0}{1}% + {\cmdGR@cl@prefixx}{8}{0}{2}{3} +\or + \begin{scope}[rotate=18] + \grCycle[#1]{5} + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{5} + \end{scope} + \edef\tkzb@ptemp{\cmdGR@cl@prefixxx} + \edef\tkzb@rtemp{\cmdGR@cl@RC} + \grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{2} + \EdgeDoubleMod{\cmdGR@cl@prefix}{5}{0}{1}% + {\cmdGR@cl@prefixx}{5}{1}{1}{4} + \EdgeDoubleMod{\cmdGR@cl@prefix}{5}{0}{1}% + {\cmdGR@cl@prefixx}{5}{4}{1}{4} + \EdgeFromOneToSel{\cmdGR@cl@prefixxx}{\cmdGR@cl@prefixx}{0}{4,0,1} + \EdgeFromOneToSel{\cmdGR@cl@prefixxx}{\cmdGR@cl@prefixx}{1}{1,2,3} + \Edge(\cmdGR@cl@prefixx3)(\cmdGR@cl@prefixx4) + \Edge(\cmdGR@cl@prefixx0)(\cmdGR@cl@prefixxx1) + \Edge(\cmdGR@cl@prefixx2)(\cmdGR@cl@prefixxx0) +\or + \grCycle[#1]{12} + \Edges(\cmdGR@cl@prefix0,\cmdGR@cl@prefix6,\cmdGR@cl@prefix3,% + \cmdGR@cl@prefix8,\cmdGR@cl@prefix11,\cmdGR@cl@prefix5,% + \cmdGR@cl@prefix2,\cmdGR@cl@prefix9,\cmdGR@cl@prefix0) + \Edges(\cmdGR@cl@prefix1,\cmdGR@cl@prefix7,\cmdGR@cl@prefix10,% + \cmdGR@cl@prefix4,\cmdGR@cl@prefix1) +\fi +\endgroup% +} + +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grBalaban +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\newcommand*{\grBalaban}[1][]{% +\begingroup% +\setkeys[GR]{cl}{#1}% +\ifcase\cmdGR@cl@form +\or + \grCycle[#1]{50} + \EdgeInGraphMod*{\cmdGR@cl@prefix}{50}{9}{3}{5} + \EdgeInGraphMod*{\cmdGR@cl@prefix}{50}{25}{0}{5} + \begin{scope}[rotate=12] + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \grCirculant[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{10}{3} + \end{scope} + \begin{scope}[rotate=24] + \edef\tkzb@ptemp{\cmdGR@cl@prefixxx} + \edef\tkzb@rtemp{\cmdGR@cl@RC} + \grCirculant[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{10}{3} + \end{scope} + \EdgeDoubleMod{\cmdGR@cl@prefix}{50}{1}{5}% + {\cmdGR@cl@prefixx}{10}{0}{1}{10} + \EdgeDoubleMod{\cmdGR@cl@prefix}{50}{4}{5}% + {\cmdGR@cl@prefixxx}{10}{0}{1}{10} +\or + \begin{scope}[rotate=9] + \grCycle[#1]{10} + \end{scope} + \begin{scope}[rotate=-9] + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \grCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{10} + \end{scope} + \begin{scope}[rotate=6] + \edef\tkzb@ptemp{\cmdGR@cl@prefixxx} + \edef\tkzb@rtemp{\cmdGR@cl@RC} + \grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{30} + \EdgeInGraphMod*{\cmdGR@cl@prefixxx}{30}{1}{0}{3} + \EdgeInGraphMod*{\cmdGR@cl@prefixxx}{30}{1}{1}{3} + \EdgeInGraphMod*{\cmdGR@cl@prefixxx}{30}{15}{1}{3} + \end{scope} + \begin{scope}[rotate=9] + \edef\tkzb@ptemp{\cmdGR@cl@prefixxxx} + \edef\tkzb@rtemp{\cmdGR@cl@RD} + \grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{20} + \EdgeInGraphMod*{\cmdGR@cl@prefixxxx}{20}{7}{0}{2} + \EdgeInGraphMod*{\cmdGR@cl@prefixxxx}{20}{5}{1}{2} + \end{scope} + \EdgeDoubleMod{\cmdGR@cl@prefix}{10}{0}{1} + {\cmdGR@cl@prefixxx}{30}{0}{3}{9} + \EdgeDoubleMod{\cmdGR@cl@prefixx}{10}{0}{1}% + {\cmdGR@cl@prefixxx}{30}{29}{3}{9} + \EdgeDoubleMod{\cmdGR@cl@prefixxx}{30}{0}{3}% + {\cmdGR@cl@prefixxxx}{20}{0}{2}{9} + \EdgeDoubleMod{\cmdGR@cl@prefixxx}{30}{2}{3}% + {\cmdGR@cl@prefixxxx}{20}{1}{2}{9} +\or +\grEmptyCycle[#1]{10} +\begin{scope}[rotate=9] + \edef\tkzb@ptemp{\cmdGR@cl@prefixx} + \edef\tkzb@rtemp{\cmdGR@cl@RB} + \grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{20} +\end{scope} +\begin{scope}[rotate=13] + \edef\tkzb@ptemp{\cmdGR@cl@prefixxx} + \edef\tkzb@rtemp{\cmdGR@cl@RC} + \grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{10} +\end{scope} +\begin{scope}[rotate=-13] + \edef\tkzb@ptemp{\cmdGR@cl@prefixxxx} + \edef\tkzb@rtemp{\cmdGR@cl@RD} + \grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{10} +\end{scope} +\begin{scope}[rotate=9] + \edef\tkzb@ptemp{\cmdGR@cl@prefixxxxx} + \edef\tkzb@rtemp{\cmdGR@cl@RE} + \grCirculant[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{20}{6} +\end{scope} + \EdgeIdentity{\cmdGR@cl@prefixx}{\cmdGR@cl@prefixxxxx}{20} + \EdgeDoubleMod{\cmdGR@cl@prefix}{10}{0}{1}% + {\cmdGR@cl@prefixx}{20}{0}{2}{10} + \EdgeDoubleMod{\cmdGR@cl@prefix}{10}{0}{1}% + {\cmdGR@cl@prefixx}{20}{19}{2}{10} + \EdgeInGraphMod{\cmdGR@cl@prefix}{10}{5} + \EdgeDoubleMod{\cmdGR@cl@prefixxx}{10}{0}{1}% + {\cmdGR@cl@prefixx}{20}{0}{2}{10} + \EdgeDoubleMod{\cmdGR@cl@prefixxxx}{10}{0}{1}% + {\cmdGR@cl@prefixx}{20}{19}{2}{10} + \EdgeDoubleMod{\cmdGR@cl@prefixxxx}{10}{0}{1}% + {\cmdGR@cl@prefixxx}{10}{1}{1}{10} + \EdgeDoubleMod{\cmdGR@cl@prefixxxx}{10}{1}{1}% + {\cmdGR@cl@prefixxx}{10}{0}{1}{10} +\fi +\endgroup% +} +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% Labels +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> + +% #2 label/prefix/num +\define@cmdkey [GR] {WL} {color}[black]{} +\define@cmdkey [GR] {WL} {labelstyle}{} +\define@cmdkey [GR] {WL} {size}{} +\define@cmdkey [GR] {WL} {style}{} +\presetkeys [GR] {WL} {color = black,% + labelstyle = {},% + size = {},% + style = {}}{} +\newcommand{\grWriteExplicitLabels}[2][]{% +\begingroup% + \setkeys[GR]{WL}{#1}% + \foreach \text/\where in {#2}{% + \node at (\where) {\text}; + }% +\endgroup% +} +\newcommand{\grWriteExplicitLabel}[2][]{% +\begingroup% + \setkeys[GR]{cl}{#1}% + \node at (\where) {\text}; +\endgroup% +}% +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% AssignVertexLabel +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\tikzset{AssignStyle/.style={}} +\define@cmdkey [GR] {AVL} {color}{} +\define@cmdkey [GR] {AVL} {size}{} +\define@cmdkey [GR] {AVL} {mathsize}{} +\define@boolkey[GR] {AVL} {Math}[true]{} +\presetkeys [GR] {AVL} {size = \normalsize,% + mathsize = \displaystyle,% + color = black,% + Math = false}{} \newcommand*{\AssignVertexLabel}[3][]{% +\begingroup% + \setkeys[GR]{AVL}{#1} + \foreach \name [count=\xi from 0] in {#3}{% + \ifGR@AVL@Math% + \node at (#2\xi) + {$\textcolor{\cmdGR@AVL@color}{\cmdGR@AVL@mathsize\name}$}; + \else + \node[AssignStyle] at (#2\xi) + {\textcolor{\cmdGR@AVL@color}{\cmdGR@AVL@size\name}}; + \fi} + +\endgroup% +} + +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% grEdgeForTree +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% #1 prefix #2 indice #2 prefix #3 indice choisie entre #4 et #5 ... +\newcommand{\grEdgeForTree}[5]{% +\begingroup% + \foreach \V@x in {#4,...,#5}{% + \Edge(#1#2)(#3\V@x)% + }% +\endgroup% +} + +\newcommand{\grSubtreeOfCage}[3][]{% + \begingroup + \setkeys[GR]{cl}{#1}% + \edef\tkzb@rtemp{\cmdGR@cl@RA} + \edef\tkzb@rtempx{\cmdGR@cl@RB} + \edef\tkzb@ptemp{\cmdGR@cl@prefix} + \ifthenelse{\isodd{#3}}% + % odd girth + {% + \pgfmathsetcounter{tkz@gr@a}{(#3-3)/2} + \Vertex{\cmdGR@cl@prefix 0\grLabelSep 0} + \edef\tkz@auxctp{\thetkz@gr@a} + \foreach \V@x in {0,...,\tkz@auxctp}{% + \pgfmathsetcounter{tkz@gr@b}{#2*((#2-1)^\V@x)}% + \pgfmathsetmacro{\sep@path}{\tkzb@rtemp/((#2-1)^\V@x)}% + \pgfmathsetmacro{\y@h}{\tkzb@rtempx*(\V@x+1)}% + \pgfmathsetcounter{tkz@gr@c}{\V@x+1}% + \grEmptyPath[% + prefix=\tkzb@ptemp\thetkz@gr@c\grLabelSep, + form=2, + RA=\sep@path, + x=0, + y=\y@h]{\thetkz@gr@b}% + }% + % edges from the root of the tree + \EdgeFromOneToAll{\tkzb@ptemp0\grLabelSep}% + {\tkzb@ptemp1\grLabelSep}{0}{#2} + % ca = levels from where extra edges emerge + % cb = edges per vertex + \pgfmathsetcounter{tkz@gr@a}{\thetkz@gr@a-1} +\edef\tkz@auxctpa{\thetkz@gr@a} + \foreach \V@y in {0,...,\tkz@auxctpa}{% + \pgfmathsetcounter{tkz@gr@b}{#2*(#2-1)^\V@y-1} +\edef\tkz@auxctpb{\thetkz@gr@b} + \foreach \a in {0,...,\tkz@auxctpb}{% + \pgfmathsetcounter{tkz@gr@c}{\a*(#2-1)}% + \pgfmathsetcounter{tkz@gr@d}{\a*(#2-1)+(#2-2)}% + \pgfmathsetcounter{tkz@gr@ta}{\V@y+1} + \pgfmathsetcounter{tkz@gr@tb}{\V@y+2} + \EdgeFromOneToSeq{\tkzb@ptemp\thetkz@gr@ta\grLabelSep}% + {\tkzb@ptemp\thetkz@gr@tb\grLabelSep}{\a}% + {\thetkz@gr@c}{\thetkz@gr@d} + }% + }% + }% + % even girth + {% + \pgfmathsetcounter{tkz@gr@a}{(#3-2)/2} + \foreach \V@x in {0,...,\thetkz@gr@a}{% + \pgfmathsetcounter{tkz@gr@b}{2*((#2-1)^\V@x)}% + \pgfmathsetmacro{\sep@path}{\tkzb@rtemp/((#2-1)^\V@x)}% + \pgfmathsetmacro{\y@h}{\tkzb@rtempx*\V@x}% + \pgfmathsetcounter{tkz@gr@c}{\V@x}% + \grEmptyPath[% + prefix=\tkzb@ptemp\thetkz@gr@c\grLabelSep, + form=2, + RA=\sep@path, + x=0, + y=\y@h]{\thetkz@gr@b}% + }% + %%%%% + \Edge% + (\tkzb@ptemp0\grLabelSep0)% + (\tkzb@ptemp0\grLabelSep1) + %%%% + \pgfmathsetcounter{tkz@gr@a}{\thetkz@gr@a-1} + \foreach \V@y in {0,...,\thetkz@gr@a}{% + \pgfmathsetcounter{tkz@gr@b}{2*(#2-1)^\V@y-1} + \foreach \a in {0,...,\thetkz@gr@b}{% + \pgfmathsetcounter{tkz@gr@c}{\a*(#2-1)}% + \pgfmathsetcounter{tkz@gr@d}{\a*(#2-1)+(#2-2)}% + \pgfmathsetcounter{tkz@gr@ta}{\V@y} + \pgfmathsetcounter{tkz@gr@tb}{\V@y+1} + \EdgeFromOneToSeq{\tkzb@ptemp\thetkz@gr@ta\grLabelSep}% + {\tkzb@ptemp\thetkz@gr@tb\grLabelSep}{\a}% + {\thetkz@gr@c}{\thetkz@gr@d} + }% + }% + }% + \endgroup +} + +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +% The End +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\catcode`\@=\tkzAtCode\relax +\endinput |