In this paper based on swarm intelligence a new approach for an on demand ad-hoc routing algorithm is proposed. The foraging behavior of Ant colony optimization and Bee colony optimization, which are the subset of swarm intelligence and considering the ability of simple ants to solve complex problems by cooperation. Several algorithms which are based on ant colony problems were introduced in the literatures to solve different problems, e.g., optimization problems. The proposed algorithm is compared and proven by results that the approach has the potential to become an appropriate routing tactics for mobile ad-hoc networks. The results were presented based on the simulations made with the implementation in ns-2.