In this paper, we propose an Artificial Bee Colony (ABC) algorithm, a swarm-based artificial intelligence algorithm, for computing a connected dominating set (CDS) in ad hoc wireless networks, which include mobile ad hoc networks (MANETS). ABC Algorithm is an optimization algorithm based on the intelligent behavior of honey bee swarm. Wireless ad hoc networks appear in a wide variety of applications, including mobile wireless networks. In this work ABC algorithm is proposed as optimizing heuristic algorithm for the connected dominating set problem in dynamic environment. This approach guarantees properties of correctness, progressiveness, locality, and seamlessness, and also has better throughput than cyclic iterative local solution (CILS) and seamless iterative local solution (SILS). Extensive simulations are conducted to evaluate the effectiveness of the proposed approach in both static and dynamic environments.