A Graph theoretic approach to matrix inversion by partitioning