lundi 1 décembre 2014

Combination of arrowed list and boxes in tikzpicture


I am trying to make a figure showing some info using tikz. At first it looked OK, but after a while everything had moved so nothing was aligned. I figured that there probably is a much better way to do this, so that things cannot move around, but I have not been able to find a way to make such a list connected to boxes. Suggestions on how to make this in a better way is appreciated!



\documentclass[tikz,border=5]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}

\node[draw, fit={(0,0)(7,1.2)}] (Meta) at (3,0) {Metaheuristic layer};

\node[draw,align=left] (Destruction) at (0,-2) {Destruction\\heuristics};
\node[draw,align=left] (Construction) at (3,-2) {Construction\\heuristics};
\node[draw,align=left] (Local) at (6,-2) {Local search\\heurstics};

\node (toDestruction) at (0,-.6){};
\node (toLocal) at (6,-.6){};

\node (topDestruction) at (-.5,-2.315){};
\node (bottomDestruction) at (-.5,-4.68){};
\node (topConstruction) at (2.5,-2.315){};
\node (bottomConstruction) at (2.5,-5.22){};
\node (topLocal) at (5.5,-2.315){};
\node (bottomLocal) at (5.5,-4.32){};

\path[->, >=triangle 45, auto, semithick]
(toDestruction) edge (Destruction)
(Meta) edge (Construction)
(toLocal) edge (Local);

\path
(topDestruction) edge (bottomDestruction)
(topConstruction) edge (bottomConstruction)
(topLocal) edge (bottomLocal);

\node[label=right:Remove K] (RemoveK) at (-.3,-3){};
\node[align=left] (RemoveKSR) at (1.0,-3.8){Remove K\\same route};
\node[align=left] (MakeK) at (1.15,-4.78){Make K\\feasible gaps};

\node[label=right:Fill the gap] (FTG) at (2.7,-3){};
\node[label=right:K-regret] (Kreg) at (2.7,-3.6){};
\node[align=left] (Solomon) at (3.6,-4.3){Solomon\\insertion};
\node[align=left] (GNN) at (3.83,-5.5){Generalized\\nearest\\neighbour};

\node[label=right:2-exchange] (2ex) at (5.7,-3){};
\node[label=right:2-interchange] (2in) at (5.7,-3.6){};
\node[label=right:Resequence] (res) at (5.7,-4.2){};

\path[->]
(-.5,-3) edge (-.1,-3)
(-.5,-3.6) edge (-.1,-3.6)
(-.5,-4.55) edge (-.1,-4.55)
(2.5,-3) edge (2.9,-3)
(2.5,-3.6) edge (2.9,-3.6)
(2.5,-4.1) edge (2.9,-4.1)
(2.5,-5.1) edge (2.9,-5.1)
(5.5,-3) edge (5.9,-3)
(5.5,-3.6) edge (5.9,-3.6)
(5.5,-4.2) edge (5.9,-4.2);

\end{tikzpicture}
\end{document}




Aucun commentaire:

Enregistrer un commentaire