1

Don´t appear the lines in the last lines of code to show the sequence!!1

(edited after Crishtopher suggestion/comment)

What I want is(marked in red): enter image description here


\documentclass[12pt,a4paper]{article}
\usepackage{amsmath,amsfonts,amssymb,latexsym}

\usepackage{pst-node}
\usepackage{pst-blur}


%\input{pssettings.tex}
\begin{document}
\psset{framearc=0.2,shadowcolor=black!70,shadowangle=-90}‎
\begin{psmatrix}[rowsep=2.9cm,colsep=0.5]% defines the distance between two frames
    &
    \psframe[fillcolor=lightgray,linestyle=none,blur,shadow](-1.00,-1.00)(1.00,1.00)
    \cnode[fillstyle=solid,fillcolor=blue](0,0){0.15}{Current}
    \rput(0,-1.35){Solución Actual}
    \\
       &
    \psframe[fillcolor=lightgray,linestyle=none,shadow,blur](-1.00,-1.00)(1.00,1.00)
    \cnode[fillstyle=solid,fillcolor=blue](0,0){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.75,0.75){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0,0.65){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.75,0.75){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.55,0.15){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.65,0.15){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.75,-0.55){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.05,-0.5){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.65,-0.65){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.35,-0.40){0.15}{Current}
    \rput(0,-1.35){Generar Vecindad}
    \\

    \psframe[fillcolor=lightgray,linestyle=none,shadow,blur](-1.00,-1.00)(1.00,1.00)
    \cnode[fillstyle=solid,fillcolor=blue](0,0){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.75,0.75){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0,0.65){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.75,0.75){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.75,0.15){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=green](0.65,0.15){0.15}{Boa}
    \psline[linecolor=red,linewidth=0.09,opacity=0.3]{-}(0.40,0.40)(0.90,-0.10)
    \psline[linecolor=red,linewidth=0.09,opacity=0.3]{-}(0.40,-0.10)(0.90,0.40)

    %\psline[linewidth=0.1]{->}(1.5,-0.2)(0.84,0.16)
    \cnode[fillstyle=solid,fillcolor=pink](-0.75,-0.55){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.05,-0.5){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.65,-0.65){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.35,-0.40){0.15}{Current}
     &
    \psframe[fillcolor=lightgray,linestyle=none,shadow,blur](-1.00,-1.00)(1.00,1.00)
    \cnode[fillstyle=solid,fillcolor=blue](0,0){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.75,0.75){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0,0.65){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.75,0.75){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.75,0.15){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=green](0.65,0.15){0.15}{Boa}
    \psline[linewidth=0.1]{->}(1.5,-0.2)(0.84,0.16)
    \cnode[fillstyle=solid,fillcolor=pink](-0.75,-0.55){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.05,-0.5){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.65,-0.65){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.35,-0.40){0.15}{Current}
    \rput(0,-1.35){Elegir el Mejor Vecino}
    \\

\psdiabox[shadow=true,framesep=0.1]{\tabular{c}Criterio de\\ Aspiración\endtabular}
    &\psdiabox[shadow=true]{\tabular{c}Está en\\ Lista Tabú?\endtabular}\\
    &
    \psframe[fillcolor=lightgray,linestyle=none,shadow,blur](-1.00,-1.00)(1.00,1.00)
    \cnode[fillstyle=solid,fillcolor=green](0.65,0.15){0.15}{Boa}
    \psline[linewidth=0.1]{->}(1.5,-0.2)(0.84,0.16)
    \rput(0,-1.35){\tabular{c}Aceptarla como nueva solución\\y comenzar de nuevo el proceso\endtabular}
    \\


       %Links
 %   \ncline{->}{1,2}{2,2}
  % \ncline{->}{3,2}{4,2}
   % \ncline{->}{4,2}{5,2}^{\textcolor{red}{No}}
%    \ncline{->}{4,2}{5,1}<{\textcolor{red}{Si}}
 %   \ncline{->}{4,1}{5,2}<{\textcolor{red}{Si}}
  %  \ncline{->}{4,1}{4,1}<{\textcolor{red}{No}}
\end{psmatrix}

\end{document} 

I think that after reach the final of this diagram, I return to pencil and paper :-)) It´s so complicated, reach what you want if you are not expert!!

  • It is hard to say what goes wrong -- I have no idea what you have in mind, how the diagram should look like. – user31729 Apr 18 '14 at 10:50
2

The problem is that initially you had empty lines (due to some \\~) and your forget these were nevertheless numbered. Whence the interest of giving names to actual nodes.

Anyway here two solutions, using (partly) either \oval or frame boxes. I give both codes, which are essentially the same, with here and there different parameters/settings and commands.

With oval boxes:

  \documentclass[10pt,a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\usepackage[textwidth = 18cm, textheight = 25cm]{geometry}

\usepackage{mathtools,amsfonts,amssymb,latexsym}

\usepackage{graphicx}

\newcommand*{\upstrut}[1]{\rule{0pt}{#1}}% creates an invisible rule of height #1
\newcommand*{\negstrut}[1]{\rule[-#1]{0pt}{#1}}% creates an invisible rule of deptht #1

\usepackage{pstricks}%[pdf]
\usepackage{pst-node}
\usepackage{pst-blur}

\newpsobject{cnodeblue}{cnode}{fillstyle=solid,fillcolor=blue}
\newpsobject{cnodepink}{cnode}{fillstyle=solid,fillcolor=pink}
\newpsobject{cnodegreen}{cnode}{fillstyle=solid,fillcolor=green}
\newpsobject{psframegray}{psframe}{fillcolor=lightgray,linestyle=none,shadow,blur}

\pagestyle{empty}
\begin{document}
%\resizebox{18cm}{!}{    % if you want to resize


\psset{framearc=0.2, shadowcolor=black!70, shadowangle=-90, unit=1.0cm}
\def\pscolhookiii{\psset[pst-node]{mcol = l}}


\begin{psmatrix}[rowsep=2.2, colsep=-1.25]% defines the distance between two frames
%
 & [name = SA]
  \psframegray(-1.00,-1.00)(1.00,1.00)
    \cnodeblue(0,0){0.15}{Current}
    \rput[t](0,-1.25){Solución Actual}&
    \\[1.25cm]
%
    & [name=GV]
    \psframegray(-1.00,-1.00)(1.00,1.00)%
    \cnodeblue(0,0){0.15}{Current}
    \cnodepink(-0.75,0.75){0.15}{Current}
    \cnodepink(0,0.65){0.15}{Current}
    \cnodepink(0.75,0.75){0.15}{Current}
    \cnodepink(-0.55,0.15){0.15}{Current}
    \cnodepink(0.65,0.15){0.15}{Current}
    \cnodepink(-0.75,-0.55){0.15}{Current}
    \cnodepink(-0.05,-0.5){0.15}{Current}
    \cnodepink(0.65,-0.65){0.15}{Current}
    \cnodepink(0.35,-0.40){0.15}{Current}
    \rput[t](0,-1.25){Generar Vecindad}
    \\[0.25cm]
    %~\\
   & [mnode = dia, shadow=true, linearc = 0.05,framesep=0.1,name = Vvacia]%
    \rule{0.8cm}{0pt}\clap{\begin{tabular}{c}¿Vecindad=$∅$?\end{tabular}}\rule[-0.21cm]{0pt}{0.6cm}\rule{0.8cm}{0pt}%{}\psdiamond(1.6,1.4)
   & [mnode = oval, shadow=true, linearc = 0.05,framesep=-0.22,name = Vfin]
    \begin{tabular}{@{}c@{\hskip\itemsep}l@{}}\textbullet &\upstrut{4ex} Finalizar \\ \textbullet & Eligir Mejor\\ &Solución Visitada\negstrut{3ex} \end{tabular}
    \\[-0.35cm]
%
  [name=Wr]
   \psframegray(-1.00,-1.00)(1.00,1.00)
    \cnodeblue(0,0){0.15}{Current}
    \cnodepink(-0.75,0.75){0.15}{Current}
    \cnodepink(0,0.65){0.15}{Current}
    \cnodepink(0.75,0.75){0.15}{Current}
    \cnodepink(-0.75,0.15){0.15}{Current}
    \cnodegreen(0.65,0.15){0.15}{Boa}
    \cnodepink(-0.75,-0.55){0.15}{Current}
    \cnodepink(-0.05,-0.5){0.15}{Current}
    \cnodepink(0.65,-0.65){0.15}{Current}
    \cnodepink(0.35,-0.40){0.15}{Current}
    \psset{linecolor=red,linewidth=0.09,opacity=0.3}
    \psline(0.40,0.40)(0.90,-0.10)
    \psline(0.40,-0.10)(0.90,0.40)
    \rput[t](0,-1.25){Eliminar Vecino Elegido}
%
     & [name=EMV]
    \psframegray(-1.00,-1.00)(1.00,1.00)
    \cnodeblue(0,0){0.15}{Current}
    \cnodepink(-0.75,0.75){0.15}{Current}
    \cnodepink(0,0.65){0.15}{Current}
    \cnodepink(0.75,0.75){0.15}{Current}
    \cnodepink(-0.75,0.15){0.15}{Current}
    \cnodegreen(0.65,0.15){0.15}{Boa}
    \psline[linewidth=0.1]{->}(1.5,-0.2)(0.84,0.16)
    \cnodepink(-0.75,-0.55){0.15}{Current}
    \cnodepink(-0.05,-0.5){0.15}{Current}
    \cnodepink(0.65,-0.65){0.15}{Current}
    \cnodepink(0.35,-0.40){0.15}{Current}
    \rput[t](0,-1.25){Elegir Mejor Vecino}
    &
    \\[0.5cm]
%
    [mnode = dia, shadow=true, linearc = 0.05,framesep=-0.2,name = CA]
    \begin{tabular}{c}¿Verifica\\Criterio de\\Aspiración?\end{tabular}
        & [mnode = dia, shadow=true, linearc = 0.05,framesep=-0.2,name = LT]
    \rule{1cm}{0pt}\clap{\begin{tabular}{c}¿Está en\\Lista Tabú? \end{tabular}}\rule[-0.45cm]{0pt}{1cm}\rule{1cm}{0pt}
    \\
%
    & [name=Ace, mnode = r]
    \psframegray(-1.00,-1.00)(1.00,1.00)
    \cnodegreen(0.65,0.15){0.15}{Boa}
    \psline[linewidth=0.1]{->}(1.5,-0.2)(0.84,0.16)
     &
    \\
%
    &    [mnode = oval, shadow=true, linearc = 0.05,framesep=-0.22,name = Repetir]
    \begin{tabular}{@{}c@{\hskip\itemsep}p{7cm}@{}} %>{}
     \textbullet\upstrut{4ex} & Actualizar Lista Tabú\\
     \textbullet & Aceptar Vecino Elegido como nueva solución\\
     \textbullet & Repetir proceso hasta alcanzar el máximo de iteraciones.\\
      \textbullet & Si se han agotado la iteraciones, tomar como Solución, la mejor de todas las visitadas \negstrut{2ex}
     \end{tabular}
%}%
\end{psmatrix}
%%% Links
\psset{linewidth=3pt, linecolor=red, arrows=->, nodesep=4pt,  linearc=0.25, angleB=180, shortput=nab, npos=0.45}
\ncline{LT}{CA}_{Si}
{\psset{nodesepB = 1.20}%
 \ncline[nodesepA = 1.65cm]{SA}{GV}%
 \ncline[nodesepA = 7pt, nodesepB = 1.15]{Vvacia}{EMV}^{No}
 \ncline[nodesepA = 7pt, nodesepB = 1.15]{LT}{Ace}^{No}%
 \ncline[nodesepB = 1.65cm]{CA}{Wr}^{No}
 \ncangle[nodesepA = 7pt, angleA = -90]{CA}{Ace}\nbput{Si}}%
 \ncline[nodesepA = 1.67cm]{EMV}{LT}%
 \ncline[nodesepA = 1.65cm]{GV}{Vvacia}
 \ncangle[nodesepA = 1.25, angleA = 90]{Wr}{Vvacia}
 \ncline{Vvacia}{Vfin}^{Si} %[nodesepA = 0.1cm]
 \ncline[nodesepA = 1.25cm]{Ace}{Repetir}
%}

\end{document}   

enter image description here

With frame boxes:

\documentclass[10pt,a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\usepackage[textwidth = 18cm, textheight = 25cm]{geometry}

\usepackage{mathtools,amsfonts,amssymb,latexsym}

\usepackage{graphicx}

\newcommand*{\upstrut}[1]{\rule{0pt}{#1}}% creates an invisible rule of height #1
\newcommand*{\negstrut}[1]{\rule[-#1]{0pt}{#1}}% creates an invisible rule of deptht #1

\usepackage{pstricks}%[pdf]
\usepackage{pst-node}
\usepackage{pst-blur}

\newpsobject{cnodeblue}{cnode}{fillstyle=solid,fillcolor=blue}
\newpsobject{cnodepink}{cnode}{fillstyle=solid,fillcolor=pink}
\newpsobject{cnodegreen}{cnode}{fillstyle=solid,fillcolor=green}
\newpsobject{psframegray}{psframe}{fillcolor=lightgray,linestyle=none,shadow,blur}

\pagestyle{empty}
\begin{document}
%\resizebox{18cm}{!}{    % if you want to resize


\psset{framearc=0.2, shadowcolor=black!70, shadowangle=-90, unit=1.0cm}
\def\pscolhookiii{\psset[pst-node]{mcol = l}}


\begin{psmatrix}[rowsep=2.2, colsep=-0.8]% defines the distance between two frames
%
 & [name = SA]
  \psframegray(-1.00,-1.00)(1.00,1.00)
    \cnodeblue(0,0){0.15}{Current}
    \rput[t](0,-1.25){Solución Actual}&
    \\[1.25cm]
%
    & [name=GV]
    \psframegray(-1.00,-1.00)(1.00,1.00)%
    \cnodeblue(0,0){0.15}{Current}
    \cnodepink(-0.75,0.75){0.15}{Current}
    \cnodepink(0,0.65){0.15}{Current}
    \cnodepink(0.75,0.75){0.15}{Current}
    \cnodepink(-0.55,0.15){0.15}{Current}
    \cnodepink(0.65,0.15){0.15}{Current}
    \cnodepink(-0.75,-0.55){0.15}{Current}
    \cnodepink(-0.05,-0.5){0.15}{Current}
    \cnodepink(0.65,-0.65){0.15}{Current}
    \cnodepink(0.35,-0.40){0.15}{Current}
    \rput[t](0,-1.25){Generar Vecindad}
    \\[0.5cm]
%
   & [mnode = dia, shadow=true, linearc = 0.05,framesep=0.1,name = Vvacia]%
    \rule{0.8cm}{0pt}\clap{\begin{tabular}{c}¿Vecindad=$∅$?\end{tabular}}\rule[-0.21cm]{0pt}{0.6cm}\rule{0.8cm}{0pt}%{}\psdiamond(1.6,1.4)
   & [mnode = r, name = Vfin]
    \psframebox[shadow=true, framearc = 0.15]{\begin{tabular}{c@{\hskip\itemsep}l}
    \textbullet & Finalizar \\ \textbullet & Eligir Mejor\\ &Solución Visitada
    \end{tabular}}
    \\
%
  [name=Wr]
   \psframegray(-1.00,-1.00)(1.00,1.00)
    \cnodeblue(0,0){0.15}{Current}
    \cnodepink(-0.75,0.75){0.15}{Current}
    \cnodepink(0,0.65){0.15}{Current}
    \cnodepink(0.75,0.75){0.15}{Current}
    \cnodepink(-0.75,0.15){0.15}{Current}
    \cnodegreen(0.65,0.15){0.15}{Boa}
    \cnodepink(-0.75,-0.55){0.15}{Current}
    \cnodepink(-0.05,-0.5){0.15}{Current}
    \cnodepink(0.65,-0.65){0.15}{Current}
    \cnodepink(0.35,-0.40){0.15}{Current}
    \psset{linecolor=red,linewidth=0.09,opacity=0.3}
    \psline(0.40,0.40)(0.90,-0.10)
    \psline(0.40,-0.10)(0.90,0.40)
    \rput[t](0,-1.25){Eliminar Vecino Elegido}
%
     & [name=EMV]
    \psframegray(-1.00,-1.00)(1.00,1.00)
    \cnodeblue(0,0){0.15}{Current}
    \cnodepink(-0.75,0.75){0.15}{Current}
    \cnodepink(0,0.65){0.15}{Current}
    \cnodepink(0.75,0.75){0.15}{Current}
    \cnodepink(-0.75,0.15){0.15}{Current}
    \cnodegreen(0.65,0.15){0.15}{Boa}
    \psline[linewidth=0.1]{->}(1.5,-0.2)(0.84,0.16)
    \cnodepink(-0.75,-0.55){0.15}{Current}
    \cnodepink(-0.05,-0.5){0.15}{Current}
    \cnodepink(0.65,-0.65){0.15}{Current}
    \cnodepink(0.35,-0.40){0.15}{Current}
    \rput[t](0,-1.25){Elegir Mejor Vecino}
    &
    \\[0.5cm]
%
    [mnode = dia, shadow=true, linearc = 0.05,framesep=-0.2,name = CA]
    \begin{tabular}{c}¿Verifica\\Criterio de\\Aspiración?\end{tabular}
        & [mnode = dia, shadow=true, linearc = 0.05,framesep=-0.2,name = LT]
    \rule{1cm}{0pt}\clap{\begin{tabular}{c}¿Está en\\Lista Tabú? \end{tabular}}\rule[-0.45cm]{0pt}{1cm}\rule{1cm}{0pt}
    \\
%
    & [name=Ace, mnode = r]
    \psframegray(-1.00,-1.00)(1.00,1.00)
    \cnodegreen(0.65,0.15){0.15}{Boa}
    \psline[linewidth=0.1]{->}(1.5,-0.2)(0.84,0.16)
     &
    \\
%
    &    [mnode =r, name = Repetir]%
    \psframebox[shadow=true,framearc = 0.15,]{\begin{tabular}{c@{\hskip\itemsep}p{7cm}} %
     \textbullet & Actualizar Lista Tabú\\
     \textbullet & Aceptar Vecino Elegido como nueva solución\\
     \textbullet & Repetir proceso hasta alcanzar el máximo de iteraciones.\\
      \textbullet & Si se han agotado la iteraciones, tomar como Solución, la mejor de todas las visitadas
     \end{tabular}}
%}%
\end{psmatrix}
%%% Links
\psset{linewidth=3pt, linecolor=red, arrows=->, nodesep=4pt,  linearc=0.25, angleB=180, shortput=nab, npos = 0.4}
\ncline{LT}{CA}_{Si}
{\psset{nodesepB = 1.20}%
 \ncline[nodesepA = 1.65cm]{SA}{GV}%
 \ncline[nodesepA = 7pt, nodesepB = 1.15]{Vvacia}{EMV}^{No}
 \ncline[nodesepA = 7pt, nodesepB = 1.15]{LT}{Ace}^{No}%
 \ncline[nodesepB = 1.65cm]{CA}{Wr}^{No}
 \ncangle[nodesepA = 7pt, angleA = -90]{CA}{Ace}\nbput[npos =0.4]{Si}}%
 \ncline[nodesepA = 1.67cm]{EMV}{LT}%
 \ncline[nodesepA = 1.65cm]{GV}{Vvacia}
 \ncangle[nodesepA = 1.25, angleA = 90]{Wr}{Vvacia}
 \ncline{Vvacia}{Vfin}^{Si} %[nodesepA = 0.1cm]
 \ncline[nodesepA = 1.25cm]{Ace}{Repetir}
%}

\end{document} 

enter image description here

  • PERFECT!!! :-) one question Why there are so sep between cols, if colsep=0.8 only?? If I change to 0.1 the separation in the graph is still the same as the col winth colsep=0.8 ¿¿?¿? I like very much your work!!! :-) – Mika Ike Apr 19 '14 at 17:23
  • 1
    For the first question: there should be a change, but betwwen column 1 and column 2, it must be hard to see , because of the \def\pscolhookii{\hskip 2cm} command which inserts a horizontal space of 2 cm at the beginning of every entry of column 2 — which is the same as increasing colsep by 2 cm vetween column 1 and column2/ If you find it's too much, change it. – Bernard Apr 19 '14 at 17:52
  • 1
    For the second question, it is enough to add at the very beginning unit=0.8cm to the series of \psset{…} (remember the default is 1 cm). Do not scale the figure: it will also scale the font. – Bernard Apr 19 '14 at 17:55
  • 1
    @Mika Ike: Thank you for the compliment, but please don't compare me with Herbert. He knows so much more than me. I've just been using pstricks for more than 15 years, so I've become fussy — just as (La)TeX makes you fussy about typography.. – Bernard Apr 19 '14 at 20:56
  • 1
    @Mika Ikke: I've updated my answer, with both variants (oval boxes ans frame boxes). Is that what you want? – Bernard Apr 21 '14 at 10:03

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.