简体   繁体   中英

Check if 2 minimum DFA are equivalent

I have 2 minimized DFA and i need to check if they are equivalent.

If they are equivalent, the problem is to find a efficient comparison of state regardless of different labels. In my case DFA are table, then i need to find the permutation that match the rows of first DFA with rows of second DFA.

I thought also about to have a Breadth-first search of DFA and create the minimum access string to a state and then compare the first list with the second list (this should be regardless of the particular input, for example: 001 and 110 could be interchangeable).

I'm interesting either to direct and inefficient algorithm and to more sophisticated algorithm.

The right approach is to construct another DFA with: L3=(L1-L2) U (L2-L1) And test whether L3 is empty or not. If L3 is empty then L1=L2, otherwise L1<>L2

I found these algorithms:

 - Symmetric difference
 - Table-filling algorithm
 - Faster Table-Filling algorithm O(n^2)
 - Hopcroft algorithm
 - Nearly Linear algorithm by Hopcroft and Karp

A complete reference is:

I accepted this my answere because the one of @abbaasi is too incomplete. I will accept any other answer with a significant contribution.

I remeber a minimum DFA is unique. So if you have 2 minimized DFA, I think you only need to check whether they're the same.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM