Deadlock Detection for a Class of Communicating Finite State Machine

Let M and N be two communicating finite state machines which exchange one type of message. We develope a polynomial algorithm to detect whether or not M and N can reach a deadlock. The time complexity of the algorithm is O(m^{3}n^{3} and its space is O(mn) where m and n are the numbers of states in M and N , respectively. The algorithm can also be used to verify that two communicating machines which exchange many types of messages are deadlock-free.