I am simply paraphrasing @Guy's answer.
To compare the languages adopted by both, we need to find out if L(A) is equal to L(B) or not.
So you need to find out if the value of L(A)-L(B) and L(B)-L(A) null or not. (Reasons1)
Part 1:
To find this, build NFA X from NFA A and NFA B,
.
If X is empty, then L(A) = L(B) else L(A) != L(B) . (REASON2)
Part 2:
Now we need to figure out an effective way to prove or refute X is empty set . When will X be empty as DFA or NFA? Answer: X will be empty if there is no path leading from the start state to any of the final state of X. For this we can use BFS or DFS.
Reason1: If both values have zero, then L(A) = L(B) .
Reason 2: We can prove that many regular languages are closed with respect to intersection and union. In this way, we can efficiently create NFA X.
and for sets: 
source share