-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
280 additions
and
102 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
\begin{minipage}[c]{0.45\textwidth} | ||
\centering | ||
\underline{NIA}\vspace{10pt} | ||
\resizebox{\textwidth}{!}{ | ||
\begin{tikzpicture}[ | ||
%->, % makes the edges directed | ||
>=stealth', | ||
node distance=2.5cm, % specifies the minimum distance between two nodes. Change if necessary. | ||
% every state/.style={thick, fill=gray!10}, % sets the properties for each ’state’ node | ||
initial text=$ $, % sets the text that appears on the start arrow | ||
] | ||
\node[state, initial] (00) {$q_{0,0}$}; | ||
\node[state, right of=00] (10) {$q_{1,0}$}; | ||
\node[state, right of=10] (20) {$q_{2,0}$}; | ||
\node[state, right of=20] (30) {$q_{3,0}$}; | ||
\node[right of=30] (40) {$\vphantom{\vdots}\cdots$}; | ||
\node[accepting, state, right of=40] (n0) {$q_{n,0}$}; | ||
|
||
\node[state, above of=00] (01) {$q_{0,1}$}; | ||
\node[state, right of=01] (11) {$q_{1,1}$}; | ||
\node[state, right of=11] (21) {$q_{2,1}$}; | ||
\node[state, right of=21] (31) {$q_{3,1}$}; | ||
\node[right of=31] (41) {$\vphantom{\vdots}\cdots$}; | ||
\node[accepting, state, right of=41] (n1) {$q_{n,1}$}; | ||
|
||
\node[above of=01] (0j) {$\mathmakebox[\widthof{$\cdots$}]{\vdots}$}; | ||
\node[right of=0j] (1j) {$\mathmakebox[\widthof{$\cdots$}]{\vdots}$}; | ||
\node[right of=1j] (2j) {$\mathmakebox[\widthof{$\cdots$}]{\vdots}$}; | ||
\node[right of=2j] (3j) {$\mathmakebox[\widthof{$\cdots$}]{\vdots}$}; | ||
\node[right of=3j] (4j) {$\iddots$}; | ||
\node[accepting, right of=4j] (nj) {$\mathmakebox[\widthof{$\cdots$}]{\vdots}$}; | ||
|
||
\node[state, above of=0j] (0k) {$q_{0,k}$}; | ||
\node[state, right of=0k] (1k) {$q_{1,k}$}; | ||
\node[state, right of=1k] (2k) {$q_{2,k}$}; | ||
\node[state, right of=2k] (3k) {$q_{3,k}$}; | ||
\node[right of=3k] (4k) {$\vphantom{\vdots}\cdots$}; | ||
\node[accepting, state, right of=4k] (nk) {$q_{n,k}$}; | ||
|
||
\draw [->] (00) edge[below] node{$\sigma_1$} (10); | ||
\draw [->] (10) edge[below] node{$\sigma_2$} (20); | ||
\draw [->] (20) edge[below] node{$\sigma_3$} (30); | ||
\draw [->] (30) edge[below] node{$\sigma_4$} (40); | ||
\draw [->] (40) edge[below] node{$\sigma_n$} (n0); | ||
|
||
\draw [->] (01) edge[below] node{$\sigma_1$} (11); | ||
\draw [->] (11) edge[below] node{$\sigma_2$} (21); | ||
\draw [->] (21) edge[below] node{$\sigma_3$} (31); | ||
\draw [->] (31) edge[below] node{$\sigma_4$} (41); | ||
\draw [->] (41) edge[below] node{$\sigma_n$} (n1); | ||
|
||
\draw [->] (0j) edge[below] node{$\sigma_1$} (1j); | ||
\draw [->] (1j) edge[below] node{$\sigma_2$} (2j); | ||
\draw [->] (2j) edge[below] node{$\sigma_3$} (3j); | ||
\draw [->] (3j) edge[below] node{$\sigma_4$} (4j); | ||
\draw [->] (4j) edge[below] node{$\sigma_n$} (nj); | ||
|
||
\draw [->] (0k) edge[below] node{$\sigma_1$} (1k); | ||
\draw [->] (1k) edge[below] node{$\sigma_2$} (2k); | ||
\draw [->] (2k) edge[below] node{$\sigma_3$} (3k); | ||
\draw [->] (3k) edge[below] node{$\sigma_4$} (4k); | ||
\draw [->] (4k) edge[below] node{$\sigma_n$} (nk); | ||
|
||
\draw [->] (00) edge[left] node{$*$} (11); | ||
\draw [->] (10) edge[left] node{$*$} (21); | ||
\draw [->] (20) edge[left] node{$*$} (31); | ||
\draw [->] (30) edge[left] node{$*$} (41); | ||
\draw [->] (30) edge[bend right, below] node{$\sigma_5$} (41); | ||
\draw [->] (40) edge[ right] node{$\sigma_n$} (n1); | ||
\draw [->] (40) edge[bend right, left] node{$*$} (n1); | ||
|
||
\draw [->] (01) edge[left] node{$*$} (1j); | ||
\draw [->] (11) edge[left] node{$*$} (2j); | ||
\draw [->] (21) edge[left] node{$*$} (3j); | ||
\draw [->] (31) edge[left] node{$*$} (4j); | ||
\draw [->] (31) edge[bend right, below] node{$\sigma_5$} (4j); | ||
\draw [->] (41) edge[ right] node{$\sigma_n$} (nj); | ||
\draw [->] (41) edge[bend right, left] node{$*$} (nj); | ||
|
||
\draw [->] (0j) edge[left] node{$*$} (1k); | ||
\draw [->] (1j) edge[left] node{$*$} (2k); | ||
\draw [->] (2j) edge[left] node{$*$} (3k); | ||
\draw [->] (3j) edge[left] node{$*$} (4k); | ||
\draw [->] (3j) edge[bend right, below] node{$\sigma_5$} (4k); | ||
\draw [->] (4j) edge[ right] node{$\sigma_n$} (nk); | ||
\draw [->] (4j) edge[bend right, left] node{$*$} (nk); | ||
|
||
\draw [->] (00) edge[bend left, left] node{$*$} (01); | ||
\draw [->] (10) edge[bend left, left] node{$*$} (11); | ||
\draw [->] (20) edge[bend left, left] node{$*$} (21); | ||
\draw [->] (30) edge[bend left, left] node{$*$} (31); | ||
\draw [->] (40) edge[right] node{$*$} (41); | ||
\draw [->] (n0) edge[bend right, right] node{$*$} (n1); | ||
|
||
\draw [->] (01) edge[bend left, left] node{$*$} (0j); | ||
\draw [->] (11) edge[bend left, left] node{$*$} (1j); | ||
\draw [->] (21) edge[bend left, left] node{$*$} (2j); | ||
\draw [->] (31) edge[bend left, left] node{$*$} (3j); | ||
\draw [->] (41) edge[right] node{$*$} (4j); | ||
\draw [->] (n1) edge[bend right, right] node{$*$} (nj); | ||
|
||
\draw [->] (0j) edge[bend left, left] node{$*$} (0k); | ||
\draw [->] (1j) edge[bend left, left] node{$*$} (1k); | ||
\draw [->] (2j) edge[bend left, left] node{$*$} (2k); | ||
\draw [->] (3j) edge[bend left, left] node{$*$} (3k); | ||
\draw [->] (4j) edge[right] node{$*$} (4k); | ||
\draw [->] (nj) edge[bend right, right] node{$*$} (nk); | ||
|
||
\draw [->] (00) edge[below] node{$\sigma_2$} (21); | ||
\draw [->] (10) edge[below] node{$\sigma_3$} (31); | ||
\draw [->] (20) edge[below] node{$\sigma_4$} (41); | ||
|
||
\draw [->] (01) edge[below] node{$\sigma_2$} (2j); | ||
\draw [->] (11) edge[below] node{$\sigma_3$} (3j); | ||
\draw [->] (21) edge[below] node{$\sigma_4$} (4j); | ||
|
||
\draw [->] (0j) edge[below] node{$\sigma_2$} (2k); | ||
\draw [->] (1j) edge[below] node{$\sigma_3$} (3k); | ||
\draw [->] (2j) edge[below] node{$\sigma_4$} (4k); | ||
|
||
%https://tex.stackexchange.com/a/20986/139648 | ||
\draw [decorate,decoration={brace,amplitude=10pt,raise=10pt,mirror}] (00.south west) -- (n0.south east) node[midway,yshift=-3em]{\textbf{String length}}; | ||
\draw [decorate,decoration={brace,amplitude=10pt,raise=20pt}] (00.south west) -- (0k.north west) node[midway,xshift=-40pt,rotate=90]{\textbf{Levenshtein edit distance}}; | ||
\end{tikzpicture} | ||
} | ||
\end{minipage} | ||
\hfill | ||
\begin{minipage}[l]{5 cm} | ||
\centering | ||
\underline{CFG}\vspace{7pt} | ||
\begin{align*} | ||
S &\Rightarrow \{\cdot \in Q \mid \delta(\cdot, q_{n,0}) \leq k\}\\ | ||
* &\Rightarrow \{\cdot \in \Sigma\}\\ | ||
\big\{q_{i, j} &\Rightarrow \{q_{i, j-1}*\} \mid i, j \in [1, n]\times[1, k]\big\}\\ | ||
\big\{q_{i, j} &\Rightarrow \{q_{i-1, j-1}*\}\mid i, j\in[1, n]\times [1, k]\big\}\\ | ||
\big\{q_{i, j} &\Rightarrow \{q_{i-1, j} \sigma_i \}\mid i, j \in [1, n]\times[0, k]\big\} \\ | ||
\big\{q_{i, j} &\Rightarrow \{q_{i-2, j-1} \sigma_i\} \mid i, j \in [2, n]\times[1, k] \big\}\\ | ||
\end{align*} | ||
\end{minipage} |
Binary file not shown.
Oops, something went wrong.