A combinatorial converse to the Perron-Frobenius theorem