Skip to content
Graphviz (DOT) templates

Finite Automaton (DFA)

A DFA accepting binary strings that end in 01.

Template previewGraphviz (DOT)
DFA start q0 q0 start->q0 q2 q2 q2->q0 1 q1 q1 q2->q1 0 q0->q0 1 q0->q1 0 q1->q2 1 q1->q1 0

What this template contains

Graph
Directed
Edges
7
Source
13 lines

Make it your own.

digraph DFA {
  rankdir=LR;
  node [shape=circle, fontname="Helvetica"];
  start [shape=point];
  q2 [shape=doublecircle];

  start -> q0;
  q0 -> q1 [label="0"];
  q0 -> q0 [label="1"];
  q1 -> q1 [label="0"];
  q1 -> q2 [label="1"];
  q2 -> q1 [label="0"];
  q2 -> q0 [label="1"];
}