We consider the problem of determining the existence of a sequence of matrices driving a discrete-time multi-agent consensus system to consensus. We transform this problem into the problem of the existence of a product of the (stochastic) transition matrices that has a positive column. This allows us to make use of results from automata theory to sets of stochastic matrices. Our main result is a polynomial-time algorithm to decide the existence of a sequence of matrices achieving consensus.
Chevalier, P.-Y., Hendrickx, J., & Jungers, R. (2015). Reachability of Consensus and Synchronizing Automata. Proceedings of the 54th IEEE Conference on Decision and Control, 4139-4144. https://doi.org/10.1109/CDC.2015.7402864