# Can we efficiently convert from NFA to smallest equivalent DFA?

Definitions

For any automaton $$X$$, let $$L(X)$$ denote the language recognized by $$X$$.

For any language $$L$$, let $$sc(L)$$ denote the number of states in the smallest DFA $$X$$ such that $$L = L(X)$$.

Conversion Problem: NFA to smallest equivalent DFA

Input: A nondeterministic finite automaton $$A$$.

Output: A smallest possible deterministic finite automaton $$B$$ such that $$L(A) = L(B)$$.

We can solve this problem by converting from NFA to DFA using the powerset construction and then minimizing the resulting DFA. However, this seems inefficient.

In particular, it seems that this could run for $$O(2^{sc(L)})$$ time where $$L = L(A)$$ if the powerset construction gives us a suboptimal DFA.

Question: Is there an algorithm for this problem that runs in linear time in terms of the state complexity? By this, I mean that it runs in $$O(n + sc(L))$$ time where $$n$$ is the size of $$A$$ and $$L = L(A)$$? What about $$poly(n + sc(L))$$ time?

• @D.W. This sounds like a pretty interesting approach. I have not thought about this. Thank you for sharing! – Michael Wehar Mar 22 at 21:59

## 1 Answer

See here: https://cs.stackexchange.com/questions/61113/does-a-given-e-nfa-accepts-all-the-strings "checking whether an NFA accepts all strings is PSPACE-complete".

In particular, if an NFA accepts all strings then its smallest equivalent DFA has size 1, and so a positive answer to your question would imply P=PSPACE.

• Yes, you are totally right! I somehow didn't think of this. Thank you. :) – Michael Wehar Mar 23 at 0:03
• I guess my follow-up question is, what if $A$ is known to be a minimum NFA? Maybe the powerset construction does produce a minimum DFA in this case? I am not quite sure. – Michael Wehar Mar 23 at 0:06
• Maybe I will ask this as a separate question. What do you think? – Michael Wehar Mar 23 at 0:07
• @Michael Wehar nice question. Well, my gut feeling tells me that your followup approach shares the same doom. On the positive side, your idea works in the case where the NFA in your hands is the reverse minimum DFA for L^R. (Why? Brzozowski's algorithm.) – Hermann Gruber Mar 23 at 8:06
• @HermannGruber Thank you very much for your comment! This is a very neat insight. :) – Michael Wehar Mar 23 at 8:31