It is an important problem in topology to verify whether two embeddings are isotopic. This work proposes an algorithm for computing Haefliger-Wu invariants for isotopy based on algebraic topological methods. Given a simplicial complex embedded in the Euclidean space, the deleted product of it is the direct product with diagonal removed. The Gauss map transforms the deleted product to the unit sphere. The pull-back of the generator of the cohomology group of the sphere defines characteristic class of the isotopy of the embedding. By using Mayer Vietoris sequence and Kunneth theorem, the computational algorithm can be greatly simplified. The authors prove the ranks of homology groups of the deleted product of a closed surface and give explicit construction of the generators of the homology groups of the deleted product. Numerical experimental results show the efficiency and efficacy of the proposed method.