Algebraic method for finding equivalence groups