Note that there are some explanatory texts on larger screens.

plurals
  1. POGraphviz .dot node ordering
    primarykey
    data
    text
    <p>I'm building a epsilon NFA to recognize a regular expression using the canonical construction. I'm using subgraphs to group various parts of the regular expression. The * operator is giving me particular trouble since dot has decided to move the order of the nodes around. I've tried adding edge weights to force particular edges to be short to keep the order of the edges in line but that does not seem to be working. </p> <p>What I would like to do is force the nodes in a subgraph in to be placed in a particular order so that the output graph is recognizable as a particular type of (well known) construction. In the example below I would like edges 3, 4, 5 and 6 placed in that order, however the dot places them in the order 6, 3, 4, 5. Any pointers appreciated. </p> <p>Note that the current weight parameter produces no difference than no weight parameter at all. </p> <p>I have the following</p> <pre><code>digraph G { rankdir = LR; node [shape = none]; 0 [label = "start"]; node [shape = circle]; 1 [label = "q1"]; 2 [label = "q2"]; 3 [label = "q3"]; 4 [label = "q4"]; 5 [label = "q5"]; node [shape = doublecircle]; 6 [label = "q6"]; subgraph re1 { rank = same; edge[label = "0"]; 1 -&gt; 2; }; subgraph re2 { rank = same; edge[label = "&amp;epsilon;"]; 3 -&gt; 4 [weight = 10]; edge[label = "1"]; 4 -&gt; 5 [weight = 10]; edge[label = "&amp;epsilon;"]; 5 -&gt; 6 [weight = 10]; 5 -&gt; 4 [weight = 1]; 6 -&gt; 3 [weight = 1]; }; edge[color=black]; 0 -&gt; 1 edge[label = "&amp;epsilon;"]; 2 -&gt; 3; } </code></pre> <p><img src="https://i.stack.imgur.com/7RjnL.png" alt="graphiz output"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload