  Markov Chain Monte Carlo (MCMC) method is a widely used algorithm design
scheme with many applications. To make efficient use of this method, the key
step is to prove that the Markov chain is rapid mixing. Canonical paths is one
of the two main tools to prove rapid mixing. However, there are much fewer
success examples comparing to coupling, the other main tool. The main reason is
that there is no systematic approach or general recipe to design canonical
paths. Building up on a previous exploration by McQuillan, we develop a general
theory to design canonical paths for MCMC: We reduce the task of designing
canonical paths to solving a set of linear equations, which can be
automatically done even by a machine.
  Making use of this general approach, we obtain fully polynomial-time
randomized approximation schemes (FPRAS) for counting the number of
$b$-matching with $b\leq 7$ and $b$-edge-cover with $b\leq 2$. They are natural
generalizations of matchings and edge covers for graphs. No polynomial time
approximation was previously known for these problems.
