Simplyfiyng BasicOperations intersection#5
Conversation
Since due to De Morgan's law **A ∩ B = (A<sup>c</sup> ∪ B<sup>c</sup>)<sup>c</sup>**, the intersection operation can be simplified in order to avoid the quadratic algorithm.
|
The complement operations involve 'determinize', so this may not be a good idea. Do you have some experimental evidence that your suggestion is in fact faster in general? |
|
You're right, I did not take in consideration the non-deterministic automatas. Intersecting dozens of DFAs, I discovered that my solution is improving the performances (20% faster). Maybe the improvement I experienced is due to the characteristics of DFAs I am working with: they are very similar and the alphabet is not too big. I will come back with an appropriate analysis after further experiments. Anyway, I think it's a good idea to let people choose the preferred method by adding a new method |
|
Provided that further experiments are convinving: Let's add a static field |
Since due to De Morgan's law A ∩ B = (Ac ∪ Bc)c, the intersection operation can be simplified in order to avoid the quadratic algorithm.