We present fast algorithms for the DC and transient analyses of large-scale power grids. We reveal a compact Cholesky factorization for the coefficient matrix of the system of linear equations encountered in power grid analysis problems. By exploiting this compact structure, we obtain techniques for fast matrix inversion and matrix-vector multiplication. This new method takes full advantage of the special structure of power grids. Experimental results show that our method is more than hundred times faster for DC analysis and around ten times faster for transient simulation compared to Hspice, with these gains continuing to increase with problem size.