Combinatorial approach for computing the characteristic polynomial of a matrix