Improve language
This commit is contained in:
parent
c8ed23c39e
commit
712a2af7ce
|
@ -117,8 +117,9 @@ has an Eulerian circuit that starts and ends at node 1:
|
||||||
\subsubsection{Existence}
|
\subsubsection{Existence}
|
||||||
|
|
||||||
The existence of Eulerian paths and circuits
|
The existence of Eulerian paths and circuits
|
||||||
depends on the degrees of the nodes of the graph.
|
depends on the degrees of the nodes.
|
||||||
First, an undirected graph has an Eulerian path if all the edges
|
First, an undirected graph has an Eulerian path
|
||||||
|
exactly when all the edges
|
||||||
belong to the same connected component and
|
belong to the same connected component and
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item the degree of each node is even \emph{or}
|
\item the degree of each node is even \emph{or}
|
||||||
|
@ -126,8 +127,7 @@ belong to the same connected component and
|
||||||
and the degree of all other nodes is even.
|
and the degree of all other nodes is even.
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
In the first case, each Eulerian path of the graph
|
In the first case, each Eulerian path is also an Eulerian circuit.
|
||||||
is also an Eulerian circuit.
|
|
||||||
In the second case, the odd-degree nodes are the starting
|
In the second case, the odd-degree nodes are the starting
|
||||||
and ending nodes of an Eulerian path which is not an Eulerian circuit.
|
and ending nodes of an Eulerian path which is not an Eulerian circuit.
|
||||||
|
|
||||||
|
@ -158,9 +158,9 @@ but the graph does not contain an Eulerian circuit.
|
||||||
|
|
||||||
In a directed graph,
|
In a directed graph,
|
||||||
we focus on indegrees and outdegrees
|
we focus on indegrees and outdegrees
|
||||||
of the nodes of the graph.
|
of the nodes.
|
||||||
A directed graph contains an Eulerian path
|
A directed graph contains an Eulerian path
|
||||||
if all the edges belong to the same strongly
|
exactly when all the edges belong to the same strongly
|
||||||
connected component and
|
connected component and
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item in each node, the indegree equals the outdegree, \emph{or}
|
\item in each node, the indegree equals the outdegree, \emph{or}
|
||||||
|
@ -169,7 +169,7 @@ in another node, the outdegree is one larger than the indegree,
|
||||||
and in all other nodes, the indegree equals the outdegree.
|
and in all other nodes, the indegree equals the outdegree.
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
In the first case, each Eulerian path of the graph
|
In the first case, each Eulerian path
|
||||||
is also an Eulerian circuit,
|
is also an Eulerian circuit,
|
||||||
and in the second case, the graph contains an Eulerian path
|
and in the second case, the graph contains an Eulerian path
|
||||||
that begins at the node whose outdegree is larger
|
that begins at the node whose outdegree is larger
|
||||||
|
@ -248,7 +248,7 @@ an outgoing edge that is not included in the circuit.
|
||||||
The algorithm constructs a new path from node $x$
|
The algorithm constructs a new path from node $x$
|
||||||
that only contains edges that are not yet in the circuit.
|
that only contains edges that are not yet in the circuit.
|
||||||
Sooner or later,
|
Sooner or later,
|
||||||
the path will return to the node $x$,
|
the path will return to node $x$,
|
||||||
which creates a subcircuit.
|
which creates a subcircuit.
|
||||||
|
|
||||||
If the graph only contains an Eulerian path,
|
If the graph only contains an Eulerian path,
|
||||||
|
@ -499,7 +499,7 @@ the graph contains a Hamiltonian path.
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
A common property in these theorems and other results is
|
A common property in these theorems and other results is
|
||||||
that they guarantee the existence of a Hamiltonian
|
that they guarantee the existence of a Hamiltonian path
|
||||||
if the graph has \emph{a large number} of edges.
|
if the graph has \emph{a large number} of edges.
|
||||||
This makes sense, because the more edges the graph contains,
|
This makes sense, because the more edges the graph contains,
|
||||||
the more possibilities there is to construct a Hamiltonian path.
|
the more possibilities there is to construct a Hamiltonian path.
|
||||||
|
@ -519,12 +519,13 @@ The time complexity of such an algorithm is at least $O(n!)$,
|
||||||
because there are $n!$ different ways to choose the order of $n$ nodes.
|
because there are $n!$ different ways to choose the order of $n$ nodes.
|
||||||
|
|
||||||
A more efficient solution is based on dynamic programming
|
A more efficient solution is based on dynamic programming
|
||||||
(see Chapter 10.4).
|
(see Chapter 10.5).
|
||||||
The idea is to define a function $f(s,x)$,
|
The idea is to calculate values
|
||||||
where $s$ is a subset of nodes and $x$
|
of a function $\texttt{possible}(S,x)$,
|
||||||
is one of the nodes in the subset.
|
where $S$ is a subset of nodes and $x$
|
||||||
|
is one of the nodes.
|
||||||
The function indicates whether there is a Hamiltonian path
|
The function indicates whether there is a Hamiltonian path
|
||||||
that visits the nodes of $s$ and ends at node $x$.
|
that visits the nodes of $S$ and ends at node $x$.
|
||||||
It is possible to implement this solution in $O(2^n n^2)$ time.
|
It is possible to implement this solution in $O(2^n n^2)$ time.
|
||||||
|
|
||||||
\section{De Bruijn sequences}
|
\section{De Bruijn sequences}
|
||||||
|
@ -532,7 +533,6 @@ It is possible to implement this solution in $O(2^n n^2)$ time.
|
||||||
\index{De Bruijn sequence}
|
\index{De Bruijn sequence}
|
||||||
|
|
||||||
A \key{De Bruijn sequence}
|
A \key{De Bruijn sequence}
|
||||||
%\footnote{N. G. de Bruijn (1918--2012) was a Dutch mathematician.}
|
|
||||||
is a string that contains
|
is a string that contains
|
||||||
every string of length $n$
|
every string of length $n$
|
||||||
exactly once as a substring, for a fixed
|
exactly once as a substring, for a fixed
|
||||||
|
@ -548,10 +548,10 @@ combinations of three bits:
|
||||||
|
|
||||||
It turns out that each De Bruijn sequence
|
It turns out that each De Bruijn sequence
|
||||||
corresponds to an Eulerian path in a graph.
|
corresponds to an Eulerian path in a graph.
|
||||||
The idea is to construct the graph where
|
The idea is to construct a graph where
|
||||||
each node contains a string of $n-1$ characters
|
each node contains a string of $n-1$ characters
|
||||||
and each edge adds one character to the string.
|
and each edge adds one character to the string.
|
||||||
The following graph corresponds to the above example:
|
The following graph corresponds to the above scenario:
|
||||||
|
|
||||||
\begin{center}
|
\begin{center}
|
||||||
\begin{tikzpicture}[scale=0.8]
|
\begin{tikzpicture}[scale=0.8]
|
||||||
|
@ -653,7 +653,7 @@ in a square where the number of possible moves is as
|
||||||
\emph{small} as possible.
|
\emph{small} as possible.
|
||||||
|
|
||||||
For example, in the following situation, there are five
|
For example, in the following situation, there are five
|
||||||
possible squares to which the knight can move:
|
possible squares to which the knight can move (squares $a \ldots e$):
|
||||||
\begin{center}
|
\begin{center}
|
||||||
\begin{tikzpicture}[scale=0.7]
|
\begin{tikzpicture}[scale=0.7]
|
||||||
\draw (0,0) grid (5,5);
|
\draw (0,0) grid (5,5);
|
||||||
|
|
Loading…
Reference in New Issue