Content deleted Content added
m Reverted edits by 38.18.114.116 (talk) to last version by Citation bot |
m Moving Category:Finite automata to Category:Finite-state machines per Wikipedia:Categories for discussion/Speedy |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 1:
In [[theoretical computer science]], in particular in [[formal language theory]], '''Kleene's algorithm''' transforms a given [[nondeterministic finite automaton]] (NFA) into a [[regular expression]].
Together with other conversion algorithms, it establishes the equivalence of several description formats for [[regular language]]s. Alternative presentations of the same method include the "elimination method" attributed to [[Janusz Brzozowski (computer scientist)|Brzozowski]] and [[Edward J. McCluskey|McCluskey]], the algorithm of [[Robert McNaughton|McNaughton]] and [[Hisao Yamada|Yamada]],<ref>{{Cite journal|
==Algorithm description==
According to Gross and Yellen (2004),<ref name="gross2004handbook">{{cite book| title=Handbook of Graph Theory| year=2004
Given a [[Nondeterministic finite automaton#Formal definition|nondeterministic finite automaton]] ''M'' = (''Q'', Σ, δ, ''q''<sub>0</sub>, ''F''), with ''Q'' = { ''q''<sub>0</sub>,...,''q''<sub>''n''</sub> } its set of [[nondeterministic finite automaton#Formal definition|states]], the algorithm computes
Line 24:
By induction on ''k'', it can be shown that the length<ref>More precisely, the number of regular-expression symbols, "''a''<sub>''i''</sub>", "ε", "|", "<sup>*</sup>", "·"; not counting parentheses.</ref> of each expression ''R''{{su|p=''k''|b=''ij''}} is at most {{sfrac|1|3}}(4<sup>''k''+1</sup>(6''s''+7) - 4) symbols, where ''s'' denotes the number of characters in Σ.
Therefore, the length of the regular expression representing the language accepted by ''M'' is at most {{sfrac|1|3}}(4<sup>''n''+1</sup>(6''s''+7)''f'' - ''f'' - 3) symbols, where ''f'' denotes the number of final states.
This exponential blowup is inevitable, because there exist families of DFAs for which any equivalent regular expression must be of exponential size.<ref>{{Cite
In practice, the size of the regular expression obtained by running the algorithm can be very different depending on the order in which the states are considered by the procedure, i.e., the order in which they are numbered from 0 to ''n''.
Line 313:
[[Category:Algorithms]]
[[Category:Finite-state
[[Category:Regular expressions]]
|