path / condition solve

Hello,

I try to make a flowchart using graphviz, with "Yes/No" conditions on paths, but using just one instance for each condition (node), that can appear multipe time in the same graph, which depend on previous condition ... let me explain a bit more with a graphviz syntax I would use to achieve this

I have attach an image of my "output" wishes

Here we see that D is a node (for which I would just want to have a unique instance in my dot file), but it appears 2 times, based on the fact that we can lead to it with different conditions.

My question ... how can I formalize it using a dot file ?

Thx

AttachmentSize
Capture d’écran 2012-03-24 à 12.37.41.png9.37 KB

path / condition solve

Each node in a Graphviz graph is going to appear once, and only once, when the graph is drawn. You can maintain your abstract graph with one instance of each condition, but if you want it drawn as a tree, you are going to have to preprocess your graph to create an auxiliary graph with multiple copies of nodes like D before passing it on to be drawn. If nodes like D always have no out edges, you can use a simple gvpr script to create clones of the node. Thus, each edge A -> D would be deleted and replaced with an edge A -> _di, with i goes from 1 to the number of in edges of D and where each node _di has label="D". If D has out edges, you can employ the same procedure for all but one of the in edges, or you can replicate the subtree below D for each _di clone.

Recent comments