I want to draw a Hypergraph using TikZ that looks like this
What I have so far:
\usepackage{tikz}
\usetikzlibrary{calc, positioning, fit, shapes.misc}
\begin{document}
\begin{tikzpicture}
[
he/.style={draw, rounded corners}, % he = hyper edge
ce/.style={draw, dashed, rounded corners} % ce = condition edge
]
\node (f) at (0,0) {$F$};
\node (g) at (1,0) {$G$};
\node (e) at (2,0) {$E$};
\node (d) at (2,1) {$D$};
\node (a) at (2,2) {$A$};
\node (b) at (3,2) {$B$};
\node [he, fit=(f) (g)] {};
\node [ce, fit=(g) (e)] {};
\node [he, fit=(a) (d) (e)] {};
\node [ce, fit=(a) (b) (d)] {};
\end{tikzpicture}
\end{document}
I didn't manage to ..
- Make the hyperedges a little bit smaller like in the original picture, so that you can distinguish between hyperedges and condition edges
- Make the ABD condition edge a triangle with rounded corners
Do you have any ideas how to do this? Furthermore, this is my first time working with TikZ, so if you have any other recommendations on how to improve the way of creating this graph and how to define styles, I would be happy to learn more.
inner sep=0pt
in style definition ofhe
to make hyper edges smaller – nidhin Oct 28 '18 at 12:11scale
, butinner sep
works better. – ncw Oct 28 '18 at 12:16