简体   繁体   English

检查 2 个最小 DFA 是否相等

[英]Check if 2 minimum DFA are equivalent

I have 2 minimized DFA and i need to check if they are equivalent.我有 2 个最小化的 DFA,我需要检查它们是否相等。

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.在我的情况下,DFA 是表,然后我需要找到将第一个 DFA 的行与第二个 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).我还想对 DFA 进行广度优先搜索并创建一个状态的最小访问字符串,然后将第一个列表与第二个列表进行比较(这应该与特定输入无关,例如:001 和 110 可能是可互换)。

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.正确的做法是构造另一个 DFA,其中: L3=(L1-L2) U (L2-L1) 并测试 L3 是否为空。 If L3 is empty then L1=L2, otherwise L1<>L2如果 L3 为空,则 L1=L2,否则 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.我接受了我的回答,因为@abbaasi 中的一个太不完整了。 I will accept any other answer with a significant contribution.我会接受任何其他有重大贡献的答案。

I remeber a minimum DFA is unique.我记得最小 DFA 是唯一的。 So if you have 2 minimized DFA, I think you only need to check whether they're the same.因此,如果您有 2 个最小化的 DFA,我认为您只需要检查它们是否相同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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