% ------------------------------------------------------------------------------
% 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=4cm,
    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]          (A) {\emph{$1$}};
\node[state, right of=A]                  (B) {\emph{$2$}};
\node[state, below of=A]                  (C) {\emph{$4$}};
\node[state, below of=B]                  (D) {\emph{$5$}};
\node[state, right of=D]                  (E) {\emph{$6$}};
\node[state, above of=E]                  (F) {\emph{$7$}};
\node[state, above=2cm of $(A.north)!0.5!(B.north)$] (G) {\emph{$3$}};

\path[-{Stealth[scale=1.4]}]
    (A) edge[loop above]               node[align=center] {\texttt{d}} (A)
    (A) edge[bend left, above, dashed] node[align=center] {\texttt{a}} (B)
    (B) edge[bend left, below, dashed] node[align=center] {\texttt{b}} (A)
    (A) edge[left, dashed]             node[align=center] {\texttt{b}} (G)
    (G) edge[right]                    node[align=center] {\texttt{c}} (B)
    (B) edge[right]                    node[align=center] {\texttt{d}} (D)
    (C) edge[left]                     node[align=center] {\texttt{d}} (A)
    (B) edge[below, pos=0.75]          node[align=center] {\texttt{c}} (C)
    (D) edge[above, pos=0.25]          node[align=center] {\texttt{c}} (A)
    (D) edge[above, dashed]            node[align=center] {\texttt{b}} (C)
    (D) edge[above, dashed]            node[align=center] {\texttt{a}} (E)
    (E) edge[left]                     node[align=center] {\texttt{e}} (F)
;

\end{tikzpicture}
\end{document}
