[Tex/LaTex] Drawing directed hyperedges with TikZ

graphstikz-pgf

I'm currently working with modelchecking of symbolic dependecy graphs for my semester project in Computer Science, and am dire need of an easy way to draw dependency graphs preferably using TikZ.

My problem is somewhat related to this, but i need the arcs to be directed.

A hyperedge e is a tuple e = (v, T) where v is a source node and T is the target set. Each element in T is a tuple t = (w, t) where w is either a non-negative integer or a parameter and t is a target node.

The follwing example (found here) does exactly what i need, except i need the arcs to be directed.

\documentclass{standalone}
\usepackage{tikz}

\newcommand{\hyperedge}[4][180]{
     \draw (#2.#1) ++(#1:.5)  edge (#2) edge (#3) edge (#4);    
}

\begin{document}
\begin{tikzpicture}[
    y=.7cm, x=1cm,
    every edge/.append style={thick}
]

\node (c) at (0,0) {c};
\node (a) at (1,1) {d};
\node (b) at (1,-1) {e};


\hyperedge[0]{c}{b}{a}
\end{tikzpicture}
\end{document}

I tried adding -> as an option to the tikzpicture, but this resulted in arrows not just to the target set but also to the source node.

Best Answer

For this specific case you can modify the \hypergraph command to read

\newcommand{\hyperedge}[4][180]{
     \draw (#2.#1) ++(#1:.5)  edge (#2) edge[->] (#3) edge[->] (#4);    
}

which will add arrows to two of the edges, those leading to the target nodes.

enter image description here

\documentclass{standalone}
\usepackage{tikz}

\newcommand{\hyperedge}[4][180]{
     \draw (#2.#1) ++(#1:.5)  edge (#2) edge[->] (#3) edge[->] (#4);    
}

\begin{document}
\begin{tikzpicture}[
    y=.7cm, x=1cm,
    every edge/.append style={thick}
]

\node (c) at (0,0) {c};
\node (a) at (1,1) {d};
\node (b) at (1,-1) {e};


\hyperedge[0]{c}{b}{a}
\end{tikzpicture}
\end{document}