  We generalize the multilevel algorithm of Luescher and Weisz to study SU(N)
Yang-Mills theories with the tree-level improved gauge action. We test this
algorithm, comparing its results with those obtained using the Wilson action,
in SU(3) and SU(4) Yang-Mills theories in 2+1 and 3+1 dimensions. We measure
the static quark potential and extract the Luescher term, predicted by the
bosonic string theory.
