4

How can I remove the up arrowheads at the right side and why they are appear? thanks a lot !

\documentclass[a4paper,twoside,10pt]{memoir}
\usepackage{alphabeta}
\def\eng#1{\textlatin{#1}}
\usepackage{textcase}
\usepackage{silence}
\usepackage{kerkis}
\usepackage{color}
\usepackage[svgnames,x11names,named]{xcolor}
\WarningFilter*{mdframed}{You got a bad break}
\WarningFilter{latex}{Text page}
\usepackage[usetwoside]{mdframed}
\usepackage[LGR,T1]{fontenc}
\usepackage{anyfontsize}
\usepackage{lipsum}
\usepackage {tikz}
\usetikzlibrary {positioning,graphs,calc,decorations.pathmorphing,shapes,arrows.meta,arrows,bending,decorations.markings}
\usepackage{graphicx}
\usepackage{stix}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{systeme}
\usepackage{wrapfig}
\usepackage{afterpage}
\usepackage{tocloft}
\usepackage[figuresright]{rotating}
\usepackage{parskip}
\usepackage{caption}
\usepackage{enumitem}
\usepackage{titletoc}
\usepackage{calc}
\usepackage{pstricks}
\usepackage{bbm}
\usepackage{textcomp}
\usepackage{upgreek}
\usepackage{ifthen}
\usepackage{extramarks}
\usepackage{bm}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{colortbl}

\begin{document}

\begin{center}
\tikzset{every loop/.style={min distance=15mm,looseness=10}}
\begin{tikzpicture}[-latex ,auto ,node distance =1cm and 1cm, on grid,semithick ,
state/.style ={circle, draw, color=black , fill=cyan!20, text=black , minimum width =0.2 cm}]
\draw (1,4) node [state][rectangle] (a1) {$\bm{w}$};
\draw (3,6) node [state][rectangle] (b2) {$\bm{wx}$};
\draw (3,1) node [state][rectangle] (a2) {$\bm{wv}$};
\draw (6,8) node [state][rectangle] (c3) {$\bm{wxx}$};
\draw (6,5) node [state][rectangle] (b3) {$\bm{wxv}$};
\draw (6,1) node [state][rectangle] (a3) {$\bm{wvx}$};
\draw (8,9) node [state][rectangle] (e4) {$\bm{wxxx}$};
\draw (8,7) node [state][rectangle] (d4) {$\bm{wxxv}$};
\draw (8,5) node [state][rectangle] (c4) {$\bm{wxvx}$};
\draw (8,2) node [state][rectangle] (b4) {$\bm{wvxx}$};
\draw (8,0) node [state][rectangle] (a4) {$\bm{wvxv}$};
\draw (10,0) node [state][rectangle] (a5) {$\bm{wvxvv}$};
\draw (10,1) node [state][rectangle] (b5) {$\bm{wvxxv}$};
\draw (10,3) node [state][rectangle] (c5) {$\bm{wvxxx}$};
\draw (10,4) node [state][rectangle] (d5) {$\bm{wxvxv}$};
\draw (10,6) node [state][rectangle] (e5) {$\bm{wxvxx}$};
\draw (10,7) node [state][rectangle] (f5) {$\bm{wxxvx}$};
\draw (10,8) node [state][rectangle] (g5) {$\bm{wxxxv}$};
\draw (10,10) node [state][rectangle] (h5) {$\bm{wxxxx}$};
\draw (12,10.2) node [draw=none,fill=none] (p1) {};
\draw (12,9.8) node [draw=none,fill=none] (p2) {};
\draw (12,8) node [draw=none,fill=none] (p3) {};
\draw (12,7.2) node [draw=none,fill=none] (p4) {};
\draw (12,6.8) node [draw=none,fill=none] (p5) {};
\draw (12,5.8) node [draw=none,fill=none] (p6) {};
\draw (12,6.2) node [draw=none,fill=none] (p7) {};
\draw (12,4) node [draw=none,fill=none] (p8) {};
\draw (12,3.2) node [draw=none,fill=none] (p9) {};
\draw (12,2.8) node [draw=none,fill=none] (p10) {};
\draw (12,1) node [draw=none,fill=none] (p11) {};
\draw (12,0.2) node [draw=none,fill=none] (p12) {};
\draw (12,-0.2) node [draw=none,fill=none] (p13) {};
\path (a1) edge (a2);
\path (a1) edge (b2);
\path (a2) edge (a3);
\path (b2) edge (c3);
\path (b2) edge (b3);
\path (a3) edge (a4);
\path (a3) edge (b4);
\path (b3) edge (c4);
\path (c3) edge (d4);
\path (c3) edge (e4);
\path (a4) edge (a5);
\path (b4) edge (b5);
\path (b4) edge (c5);
\path (c4) edge (d5);
\path (c4) edge (e5);
\path (d4) edge (f5);
\path (e4) edge (g5);
\path (e4) edge (h5);
\path (h5) edge [dashed] (p1);
\path (h5) edge [dashed] (p2);
\path (g5) edge [dashed] (p3);
\path (f5) edge [dashed] (p4);
\path (f5) edge [dashed] (p5);
\path (e5) edge [dashed] (p6);
\path (e5) edge [dashed] (p7);
\path (d5) edge [dashed] (p8);
\path (c5) edge [dashed] (p9);
\path (c5) edge [dashed] (p10);
\path (b5) edge [dashed] (p11);
\path (a5) edge [dashed] (p12);
\path (a5) edge [dashed] (p13);
\end{tikzpicture}
\end{center}

\end{document} 
2

This is the third time that I post a second answer on this site. The reason is that I believe that my above answer answers the original question. This is just for fun, and also to tell AndréC, with whom I agree most of the time, that here I do not think that using graphs is a good idea. Rather, if you seek simplification, use forest for that.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage[edges]{forest}
\usepackage{bm}
\begin{document}
\tikzset{state/.style ={draw=black , fill=cyan!20, text=black , minimum width =0.2 cm}}
\newcommand{\DrawOne}{\draw[dashed,-latex] () -- ++ (2,0);}
\newcommand{\DrawTwo}{\draw[dashed,-latex] () -- ++ (2,0.2);
\draw[dashed,-latex] () -- ++ (2,-0.2);}
\begin{forest}
for tree={state,edge={-latex},grow'=east,l sep=12mm,s sep=10mm},
delay={for tree={content={$\bm{#1}$}}},
[w
 [wx
  [wxx
   [wxxx
    [wxxxx]{\DrawTwo}
    [wxxxv]{\DrawOne}
   ]
   [wxxv
    [wxxvx]{\DrawTwo}
   ]
  ]
  [wxv
   [wxvx
    [wxvxx]{\DrawTwo}
    [wxvxv]{\DrawOne}
   ]
  ]
 ]
 [wv
  [wvx
   [wvxx
    [wvxxx]{\DrawTwo}
    [wvxxv]{\DrawOne}
   ]
   [wvxv
    [wvxvx]{\DrawTwo}
   ]
  ]
 ]
]
\end{forest}
\end{document}

enter image description here

As you can see, there is not a single explicit coordinate. And if you ever decide to add some more nodes, or to change the way the nodes get connected: it will be a simple switch, not a complete revision of the code. Your tree (yes, such diagrams are called trees ;-) seems to have a simple pattern, which I was not able to understand completely. However, if there is a pattern, you could simply use delay and content/.wrap n pgfmath args to fill all nodes automatically. (But I guess this would deserve a new question, and an answer by @cfr.;-)

4

Now the arrows are gone. So are all the unrelated packages and libraries. The arrows come from the somewhat self-contradictory lines of the type \draw (12,10.2) node [draw=none,fill=none] (p1) {}; in connection with -latex in the picture options.

\documentclass[a4paper,twoside,10pt]{memoir}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{bm}

\begin{document}

\begin{center}
\tikzset{every loop/.style={min distance=15mm,looseness=10}}
\begin{tikzpicture}[auto ,node distance =1cm and 1cm, on grid,semithick ,
state/.style ={circle, draw, color=black , fill=cyan!20, text=black , minimum width =0.2 cm}]
\draw (1,4) node [state][rectangle] (a1) {$\bm{w}$};
\draw (3,6) node [state][rectangle] (b2) {$\bm{wx}$};
\draw (3,1) node [state][rectangle] (a2) {$\bm{wv}$};
\draw (6,8) node [state][rectangle] (c3) {$\bm{wxx}$};
\draw (6,5) node [state][rectangle] (b3) {$\bm{wxv}$};
\draw (6,1) node [state][rectangle] (a3) {$\bm{wvx}$};
\draw (8,9) node [state][rectangle] (e4) {$\bm{wxxx}$};
\draw (8,7) node [state][rectangle] (d4) {$\bm{wxxv}$};
\draw (8,5) node [state][rectangle] (c4) {$\bm{wxvx}$};
\draw (8,2) node [state][rectangle] (b4) {$\bm{wvxx}$};
\draw (8,0) node [state][rectangle] (a4) {$\bm{wvxv}$};
\draw (10,0) node [state][rectangle] (a5) {$\bm{wvxvv}$};
\draw (10,1) node [state][rectangle] (b5) {$\bm{wvxxv}$};
\draw (10,3) node [state][rectangle] (c5) {$\bm{wvxxx}$};
\draw (10,4) node [state][rectangle] (d5) {$\bm{wxvxv}$};
\draw (10,6) node [state][rectangle] (e5) {$\bm{wxvxx}$};
\draw (10,7) node [state][rectangle] (f5) {$\bm{wxxvx}$};
\draw (10,8) node [state][rectangle] (g5) {$\bm{wxxxv}$};
\draw (10,10) node [state][rectangle] (h5) {$\bm{wxxxx}$};
\draw (12,10.2) node [draw=none,fill=none] (p1) {};
\draw (12,9.8) node [draw=none,fill=none] (p2) {};
\draw (12,8) node [draw=none,fill=none] (p3) {};
\draw (12,7.2) node [draw=none,fill=none] (p4) {};
\draw (12,6.8) node [draw=none,fill=none] (p5) {};
\draw (12,5.8) node [draw=none,fill=none] (p6) {};
\draw (12,6.2) node [draw=none,fill=none] (p7) {};
\draw (12,4) node [draw=none,fill=none] (p8) {};
\draw (12,3.2) node [draw=none,fill=none] (p9) {};
\draw (12,2.8) node [draw=none,fill=none] (p10) {};
\draw (12,1) node [draw=none,fill=none] (p11) {};
\draw (12,0.2) node [draw=none,fill=none] (p12) {};
\draw (12,-0.2) node [draw=none,fill=none] (p13) {};
\begin{scope}[-latex]
\path (a1) edge (a2);
\path (a1) edge (b2);
\path (a2) edge (a3);
\path (b2) edge (c3);
\path (b2) edge (b3);
\path (a3) edge (a4);
\path (a3) edge (b4);
\path (b3) edge (c4);
\path (c3) edge (d4);
\path (c3) edge (e4);
\path (a4) edge (a5);
\path (b4) edge (b5);
\path (b4) edge (c5);
\path (c4) edge (d5);
\path (c4) edge (e5);
\path (d4) edge (f5);
\path (e4) edge (g5);
\path (e4) edge (h5);
\path (h5) edge [dashed] (p1);
\path (h5) edge [dashed] (p2);
\path (g5) edge [dashed] (p3);
\path (f5) edge [dashed] (p4);
\path (f5) edge [dashed] (p5);
\path (e5) edge [dashed] (p6);
\path (e5) edge [dashed] (p7);
\path (d5) edge [dashed] (p8);
\path (c5) edge [dashed] (p9);
\path (c5) edge [dashed] (p10);
\path (b5) edge [dashed] (p11);
\path (a5) edge [dashed] (p12);
\path (a5) edge [dashed] (p13);
\end{scope}
\end{tikzpicture}
\end{center}

\end{document}

enter image description here

Of course, you may want to apply some immediate simplifications to your code. For instance, none of your nodes is a circle because you override all circles with rectangles. And instead of this lengthy expressions you could just use coordinates.

\documentclass[a4paper,twoside,10pt]{memoir}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{bm}

\begin{document}

\begin{center}
\begin{tikzpicture}[auto ,node distance =1cm and 1cm, on grid,semithick ,
state/.style ={draw, color=black , fill=cyan!20, text=black , minimum width =0.2 cm}]
\draw (1,4) node [state] (a1) {$\bm{w}$};
\draw (3,6) node [state] (b2) {$\bm{wx}$};
\draw (3,1) node [state] (a2) {$\bm{wv}$};
\draw (6,8) node [state] (c3) {$\bm{wxx}$};
\draw (6,5) node [state] (b3) {$\bm{wxv}$};
\draw (6,1) node [state] (a3) {$\bm{wvx}$};
\draw (8,9) node [state] (e4) {$\bm{wxxx}$};
\draw (8,7) node [state] (d4) {$\bm{wxxv}$};
\draw (8,5) node [state] (c4) {$\bm{wxvx}$};
\draw (8,2) node [state] (b4) {$\bm{wvxx}$};
\draw (8,0) node [state] (a4) {$\bm{wvxv}$};
\draw (10,0) node [state] (a5) {$\bm{wvxvv}$};
\draw (10,1) node [state] (b5) {$\bm{wvxxv}$};
\draw (10,3) node [state] (c5) {$\bm{wvxxx}$};
\draw (10,4) node [state] (d5) {$\bm{wxvxv}$};
\draw (10,6) node [state] (e5) {$\bm{wxvxx}$};
\draw (10,7) node [state] (f5) {$\bm{wxxvx}$};
\draw (10,8) node [state] (g5) {$\bm{wxxxv}$};
\draw (10,10) node [state] (h5) {$\bm{wxxxx}$};
\path (12,10.2) coordinate (p1) 
 (12,9.8) coordinate (p2) 
 (12,8) coordinate (p3) 
 (12,7.2) coordinate (p4) 
 (12,6.8) coordinate (p5) 
 (12,5.8) coordinate (p6) 
 (12,6.2) coordinate (p7) 
 (12,4) coordinate (p8) 
 (12,3.2) coordinate (p9) 
 (12,2.8) coordinate (p10) 
 (12,1) coordinate (p11) 
 (12,0.2) coordinate (p12) 
 (12,-0.2) coordinate (p13);
\begin{scope}[-latex]
\path (a1) edge (a2);
\path (a1) edge (b2);
\path (a2) edge (a3);
\path (b2) edge (c3);
\path (b2) edge (b3);
\path (a3) edge (a4);
\path (a3) edge (b4);
\path (b3) edge (c4);
\path (c3) edge (d4);
\path (c3) edge (e4);
\path (a4) edge (a5);
\path (b4) edge (b5);
\path (b4) edge (c5);
\path (c4) edge (d5);
\path (c4) edge (e5);
\path (d4) edge (f5);
\path (e4) edge (g5);
\path (e4) edge (h5);
\path (h5) edge [dashed] (p1);
\path (h5) edge [dashed] (p2);
\path (g5) edge [dashed] (p3);
\path (f5) edge [dashed] (p4);
\path (f5) edge [dashed] (p5);
\path (e5) edge [dashed] (p6);
\path (e5) edge [dashed] (p7);
\path (d5) edge [dashed] (p8);
\path (c5) edge [dashed] (p9);
\path (c5) edge [dashed] (p10);
\path (b5) edge [dashed] (p11);
\path (a5) edge [dashed] (p12);
\path (a5) edge [dashed] (p13);
\end{scope}
\end{tikzpicture}
\end{center}
\end{document} 

On the long run, however, you may not want to use all the explicit coordinates, but really work with positioning, but I leave that for another day.

4

In addition to the response from @marmot, I would like to point out that the problem comes from the fact that you use the \draw operation to place nodes instead of the \node operation.

I rewrote your code using only the operation \node and placed nodes with the same options in a scope environment to lighten the code.

\begin{scope}[every node/.style={state,rectangle}]

I did the same with the edges:

\begin{scope}[every edge/.style={draw,dashed}]

I have also deleted the packages that are not related to this MWE.

Update:

Since you are loading the graphs library, it is possible to use its syntax to make the code even lighter. As the nodes already exist, it is necessary to specify this with the use existing nodes option so that the graphs operation does not create new nodes.

\documentclass[a4paper,twoside,10pt]{memoir}
\usepackage {tikz}
\usetikzlibrary{graphs}
\usepackage{bm}

\begin{document}

\begin{center}
\begin{tikzpicture}[every edge/.style={draw,-latex}]

\begin{scope}[every node/.style={draw,  fill=cyan!20,  minimum width =0.2 cm,rectangle}]
\node (a1) at (1,4) {$\bm{w}$};
\node (b2) at (3,6) {$\bm{wx}$};
\node (a2) at (3,1) {$\bm{wv}$};
\node (c3) at (6,8) {$\bm{wxx}$};
\node (b3) at (6,5) {$\bm{wxv}$};
\node (a3) at (6,1) {$\bm{wvx}$};
\node (e4) at (8,9) {$\bm{wxxx}$};
\node (d4) at (8,7) {$\bm{wxxv}$};
\node (c4) at (8,5) {$\bm{wxvx}$};
\node (b4) at (8,2) {$\bm{wvxx}$};
\node (a4) at (8,0) {$\bm{wvxv}$};
\node (a5) at (10,0) {$\bm{wvxvv}$};
\node (b5) at (10,1) {$\bm{wvxxv}$};
\node (c5) at (10,3) {$\bm{wvxxx}$};
\node (d5) at (10,4) {$\bm{wxvxv}$};
\node (e5) at (10,6) {$\bm{wxvxx}$};
\node (f5) at (10,7) {$\bm{wxxvx}$};
\node (g5) at (10,8) {$\bm{wxxxv}$};
\node (h5) at (10,10) {$\bm{wxxxx}$};
\end{scope}

\node (p1) at (12,10.2){};
\node (p2) at (12,9.8){};
\node (p3) at(12,8){};
\node (p4) at (12,7.2){};
\node (p5) at (12,6.8){};
\node (p6) at (12,5.8){};
\node (p7) at (12,6.2){};
\node (p8) at (12,4){};
\node (p9) at (12,3.2){};
\node (p10) at (12,2.8){};
\node (p11) at (12,1){};
\node (p12) at (12,0.2){};
\node (p13)at (12,-0.2){};

\graph [use existing nodes]{
a1->{a2,b2},
a2->a3->{a4,b4},
b2->{b3,c3},
b3->c4,
c3->{d4,e4},
a4->a5,
b4->{b5,c5},
c4->{d5,e5},
d4->f5,
e4->{g5,h5}
};

\graph [use existing nodes,edge=dashed]{
h5->{p1,p2},
g5->p3,
f5->{p4,p5},
e5->{p6,p7},
d5->p8,
c5->{p9,p10},
b5->p11,
a5->{p12,p13}
};
\end{tikzpicture}
\end{center}
\end{document}

graphe

Old answer:

\documentclass[a4paper,twoside,10pt]{memoir}
\usepackage {tikz}
\usetikzlibrary {positioning,graphs,calc,decorations.pathmorphing,shapes,arrows.meta,arrows,bending,decorations.markings}
\usepackage{bm}

\begin{document}
\begin{center}
\tikzset{every loop/.style={min distance=15mm,looseness=10}}
\begin{tikzpicture}[-latex ,auto ,node distance =1cm and 1cm, on grid,semithick ,
state/.style ={circle, draw, color=black , fill=cyan!20, text=black , minimum width =0.2 cm}]
\begin{scope}[every node/.style={state,rectangle}]
\node (a1) at (1,4) {$\bm{w}$};
\node (b2) at (3,6) {$\bm{wx}$};
\node (a2) at (3,1) {$\bm{wv}$};
\node (c3) at (6,8) {$\bm{wxx}$};
\node (b3) at (6,5) {$\bm{wxv}$};
\node (a3) at (6,1) {$\bm{wvx}$};
\node (e4) at (8,9) {$\bm{wxxx}$};
\node (d4) at (8,7) {$\bm{wxxv}$};
\node (c4) at (8,5) {$\bm{wxvx}$};
\node (b4) at (8,2) {$\bm{wvxx}$};
\node (a4) at (8,0) {$\bm{wvxv}$};
\node (a5) at (10,0) {$\bm{wvxvv}$};
\node (b5) at (10,1) {$\bm{wvxxv}$};
\node (c5) at (10,3) {$\bm{wvxxx}$};
\node (d5) at (10,4) {$\bm{wxvxv}$};
\node (e5) at (10,6) {$\bm{wxvxx}$};
\node (f5) at (10,7) {$\bm{wxxvx}$};
\node (g5) at (10,8) {$\bm{wxxxv}$};
\node (h5) at (10,10) {$\bm{wxxxx}$};
\end{scope}

\node (p1) at (12,10.2){};
\node (p2) at (12,9.8){};
\node (p3) at(12,8){};
\node (p4) at (12,7.2){};
\node (p5) at (12,6.8){};
\node (p6) at (12,5.8){};
\node (p7) at (12,6.2){};
\node (p8) at (12,4){};
\node (p9) at (12,3.2){};
\node (p10) at (12,2.8){};
\node (p11) at (12,1){};
\node (p12) at (12,0.2){};
\node (p13)at (12,-0.2){};

\path (a1) edge (a2);
\path (a1) edge (b2);
\path (a2) edge (a3);
\path (b2) edge (c3);
\path (b2) edge (b3);
\path (a3) edge (a4);
\path (a3) edge (b4);
\path (b3) edge (c4);
\path (c3) edge (d4);
\path (c3) edge (e4);
\path (a4) edge (a5);
\path (b4) edge (b5);
\path (b4) edge (c5);
\path (c4) edge (d5);
\path (c4) edge (e5);
\path (d4) edge (f5);
\path (e4) edge (g5);
\path (e4) edge (h5);

\begin{scope}[every edge/.style={draw,dashed}]
\path (h5) edge  (p1);
\path (h5) edge  (p2);
\path (g5) edge  (p3);
\path (f5) edge  (p4);
\path (f5) edge  (p5);
\path (e5) edge  (p6);
\path (e5) edge  (p7);
\path (d5) edge  (p8);
\path (c5) edge  (p9);
\path (c5) edge  (p10);
\path (b5) edge  (p11);
\path (a5) edge  (p12);
\path (a5) edge  (p13);
\end{scope}

\end{tikzpicture}
\end{center}

\end{document}
  • Thanks a lot both of you, I am a Tikz beginner and at the moment i try just to draw my figures correctly – Athanasios Margaris Nov 4 '18 at 20:19
  • 1
    @AthanasiosMargaris I added to my answer the use of the graphs library – AndréC Nov 4 '18 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.