Given two nondeterministic finite automata M1 and M2, is there an efficient algorithm to determine whether the language accepted by M1 is a superset of the language accepted by M2?
Asked
Active
Viewed 522 times
1 Answers
2
Not unless P=NP. If you had such an algorithm, you could trivially decide whether two NFAs were isomorphic (just check if A is a superset of B and B is a superset of A), which is a known NP-hard problem. For more details, read this paper. It has a nice discouraging table of complexity results.

Mikola
- 9,176
- 2
- 34
- 41
-
I wonder, do you know of a reduction from another NP complete problem to NFA isomorphism? – hugomg Feb 26 '12 at 03:34
-
@missigno: I added a link to a paper explaining the reductions a bit more carefully. – Mikola Feb 26 '12 at 04:02
-
2Mikola, your answer is correct but your wording is wrong: isomorphic means "of equal shape", two automatas are isomorphic iff there is a 1-1 mapping between their states, such that bla bla. Which is not relevant here, two automatas may accept the same language without being isomorphic. (It adds to the confusion that checking graph isomorphism is also NP-Hard) If you edit your answer as "whether two NFAs accept the same language" instead of "whether two NFAs were isomorphic" all will be fine. – Ali Ferhat Feb 26 '12 at 11:27
-
Glaister and Shallit mention in "[A lower bound technique for the size of nondeterministic finite automata](http://ai.uwaterloo.ca/~shallit/Papers/nfa.ps)" (Glaister & Shallit 1996) that a smallest NFA accepting a language is not necessarily unique. If *L* (*M1*) ⊇ *L* (*M2*) and *L* (*M2*) ⊇ *L* (*M1*) and *M1* and *M2* are both a smallest NFA for their respective languages, then we have shown that the two automata accept the same language, but not that they are isomorphic, I believe. – Daniel Trebbien Feb 26 '12 at 17:46