Recent development of information technology and rise of social media enable us to access massive data. Large scale data such as hyperlink structure in WWW and friendship information in social media can be represented as networks based on graph theory. For analyzing such data, many methods have been proposed. Among them, the methods called community detection have advantages that they can make networks simple and easy to understand. However, most of them had not considered the background knowledge of data, thus some methods called constrained community detection which take such background knowledge into consideration have been proposed. Constrained community detection methods show robust performance on noisy data due to its background knowledge. In particular, constrained Hamiltonian-based community detection methods have advantages such as flexibility of output results. The Hamiltonian, energy in statistical mechanics, can be theoretically considered as a generalization of the Newman's modularity. In this paper, we propose a method for accelerating constrained community detection based on Hamiltonian. Our proposed method is a variant of Blondel's Louvain method which is known for its computational efficiency. We experimentally show that the proposed method is superior to the existing method based on simulated annealing in terms of computational efficiency, and its accuracy is as well as the existing method under the same conditions. Our method enables us to perform constrained community detection for larger networks compared with the existing method.