I have to implement the Gomory-Hu-Algorithms which requires the reunion of several nodes to one node like it is shown here:
My code is quite simple since the example I want to implement is quite easy and only consists of a graph and a tree that is expanded in each iteration:
\begin{tikzpicture}[auto, node distance=3cm, every loop/.style={},
thick,main node/.style={circle,fill=green!50,draw,font=\sffamily\Large\bfseries},
path/.style={circle, inner sep=2pt,fill=red!50, draw,font=\sffamily\Large\bfseries}]
\tikzstyle{edge_style} = [draw=orange, line width=2, ultra thick]
\node[main node] (b) {a,b,c,d,e};
\node[main node] (a) [below left = 1cm of b] {a};
\node[main node] (c) [right = 1.5cm of b] {c};
\node[main node] (f) [below = 2cm of b] {f};
\node[main node](e) [right = 1.5cm of f] {e};
\node[main node](d) [below right = 1cm of c] {d};
\end{tikzpicture}
As you see till now I am only able to give names like a,b,c,d to a node but what I want is to get a node including nodes with names a,b,c,d.
Best Answer
If all nodes you want to group are close,
fit
library which definesfit
nodes can help you.I don't understand the relation between the figure and your code, but following code produces the desired figure using a
fit
node.