Designing an acoustic drum can be categorized into a class of eigenvalue optimization problems in the structural engineering area. In this paper, we propose an algorithm that is based on the Gâteaux derivative of the objective function with respect to the density functions and analyze our algorithm in detail. In the algorithm, we deal with the geometry constraint by exchanging the densities of two domains occupied by two kinds of different materials. Finally we apply this algorithm to some practical examples frequently used by the researchers and present some numerical results to show its feasibility, stability and efficiency.