% ------------------------------------------------------------------------------
% Copyright (c) 2019, 2025 Contributors to the Eclipse Foundation
%
% See the NOTICE file(s) distributed with this work for additional
% information regarding copyright ownership.
%
% This program and the accompanying materials are made available under the terms
% of the MIT License which is available at https://opensource.org/licenses/MIT
%
% SPDX-License-Identifier: MIT
% ------------------------------------------------------------------------------
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta, arrows, automata, calc, positioning, shapes, shapes.misc}
\usepackage[paperwidth=40in, paperheight=20in]{geometry}

\begin{document}
\pagestyle{empty}

\begin{tikzpicture}[
    auto,
    ->,
    node distance=3cm,
    every state/.style={ellipse, semithick, fill=black!5, minimum size=1.5cm, font=\Large},
    initial distance=1.2cm,
    every initial by arrow/.style={-{Stealth[scale=1.4]}},
    initial text=,
    transform shape,
    double distance=2pt,
    every loop/.style={min distance=10mm}
]

\node[state, initial, accepting]                       (A1) {};
\node[state, right of=A1]                              (B1) {};
\node[state, below of=A1]                              (C1) {};
\node[state, above=1cm of $(A1.north)!0.5!(B1.north)$] (G1) {};

\path[-{Stealth[scale=1.4]}]
    (A1) edge[loop above]               node[align=center] {\texttt{d}} (A1)
    (A1) edge[bend left, above, dashed] node[align=center] {\texttt{a}} (B1)
    (B1) edge[bend left, below, dashed] node[align=center] {\texttt{b}} (A1)
    (A1) edge[left, dashed]             node[align=center] {\texttt{b}} (G1)
    (G1) edge[right]                    node[align=center] {\texttt{c}} (B1)
    (C1) edge[left]                     node[align=center] {\texttt{d}} (A1)
    (B1) edge[below, pos=0.75]          node[align=center] {\texttt{c}} (C1)
;

\node[state, initial, accepting, right=2.5cm of B1]    (A2) {};
\node[state, right of=A2]                              (B2) {};
\node[state, below of=A2]                              (C2) {};
\node[state, above=1cm of $(A2.north)!0.5!(B2.north)$] (G2) {};

\path[-{Stealth[scale=1.4]}]
    (A2) edge[bend left, above, dashed] node[align=center] {\texttt{a}} (B2)
    (B2) edge[bend left, below, dashed] node[align=center] {\texttt{b}} (A2)
    (A2) edge[left, dashed]             node[align=center] {\texttt{b}} (G2)
    (G2) edge[right]                    node[align=center] {\texttt{c}} (B2)
    (C2) edge[left]                     node[align=center] {\texttt{d}} (A2)
    (B2) edge[below, pos=0.75]          node[align=center] {\texttt{c}} (C2)
;

\node[state, initial, accepting, right=2.5cm of B2]    (A3) {};
\node[state, right of=A3]                              (B3) {};
\node[state, above=1cm of $(A3.north)!0.5!(B3.north)$] (G3) {};

\path[-{Stealth[scale=1.4]}]
    (A3) edge[loop above]               node[align=center] {\texttt{d}} (A3)
    (A3) edge[bend left, above, dashed] node[align=center] {\texttt{a}} (B3)
    (B3) edge[bend left, below, dashed] node[align=center] {\texttt{b}} (A3)
    (A3) edge[left, dashed]             node[align=center] {\texttt{b}} (G3)
    (G3) edge[right]                    node[align=center] {\texttt{c}} (B3)
;

\end{tikzpicture}
\end{document}
