Combinatorial algorithms for perturbation theory and application on quantum computing