  We consider the problem of determining the existence of a sequence of
matrices driving a discrete-time consensus system to consensus. We transform
this problem into one of the existence of a product of the transition
(stochastic) matrices that has a positive column. We then generalize some
results from automata theory to sets of stochastic matrices. We obtain as a
main result a polynomial-time algorithm to decide the existence of a sequence
of matrices achieving consensus.
