I'm using GraphViz to render weighted automata. They are generalizations of the usual DFA/NFA: there are states, and transitions. In the weighted case, in addition to a label, the transitions may have a weight (denoted in angle brackets in my example below). Initial and final states also have a weight.
There are several traditions to rendering initial and final states, one being a double-circle for accepting states.
I do not belong to this tradition: there should be an incoming arrow to denote an initial state, and an outgoing arrow to denote an accepting state. Besides, these arrows will carry the weight of these initial/final states.
I could not find a means to draw incoming/outgoing arrows, have I missed something? So I am cheating, and for each initial/final state, I create a phantom pre-initial/post-final state, and a pseudo-transition. The render is OK, but not so good, as even if these phantom states are invisible, Dot tries to find them a nice place, which results in weird initial/final arrows, as in the example below.
Is there a means to get a better rendering? Does someone have a nice suggestion?
Thanks in advance!
vcsn_context = "lal_char(ab)_q"
rankdir = LR
node [style = invis, shape = none, label = "", width = 0, height = 0]
node [shape = circle]
I0 -> 0
0 -> F0 [label = "<2>"]
0 -> 1 [label = "<1/3>a"]
0 -> 2 [label = "<2/3>b"]
1 -> F1 [label = "<2>"]
1 -> 1 [label = "<4/3>a"]
1 -> 2 [label = "<2/3>b"]
2 -> F2 [label = "<2>"]
2 -> 1 [label = "<1/3>a"]
2 -> 2 [label = "<5/3>b"]
|g.pdf||8.49 KB |