Finite state machine example
Graphviz ยป Graphviz gallery

Prev:Colored circles example
Next:Record example


This example is adapted from https://graphviz.org/content/fsm.

USING: graphviz graphviz.notation graphviz.render ; <digraph> "LR" =rankdir "8,5" =size [node "doublecircle" =shape ]; { "LR_0" "LR_3" "LR_4" "LR_8" } add-nodes [node "circle" =shape ]; "LR_0" "LR_2" [-> "SS(B)" =label ]; "LR_0" "LR_1" [-> "SS(S)" =label ]; "LR_1" "LR_3" [-> "S($end)" =label ]; "LR_2" "LR_6" [-> "SS(b)" =label ]; "LR_2" "LR_5" [-> "SS(a)" =label ]; "LR_2" "LR_4" [-> "S(A)" =label ]; "LR_5" "LR_7" [-> "S(b)" =label ]; "LR_5" "LR_5" [-> "S(a)" =label ]; "LR_6" "LR_6" [-> "S(b)" =label ]; "LR_6" "LR_5" [-> "S(a)" =label ]; "LR_7" "LR_8" [-> "S(b)" =label ]; "LR_7" "LR_5" [-> "S(a)" =label ]; "LR_8" "LR_6" [-> "S(b)" =label ]; "LR_8" "LR_5" [-> "S(a)" =label ]; preview