An ad hoc network facilitates communication between nodes without the existence of an established infrastructure. Random nodes are connected to one another using Ad hoc networking and routing among the nodes is done by forwarding packets from one to another which is decided dynamically. The transmission of packets among the nodes is done on a specified power level. Power control is the method used for transmission of the packets at an optimized power level so as to increase the traffic carrying capacity, reduce the usage of battery power and minimize the interference to improve the overall performance of the system with regards to the usage of power. This thesis tells us regarding COMPOW (Common Power) and CLUSTERPOW (Cluster Power) protocols, which are two existing protocols for power control in homogeneous and non-homogeneous networks respectively. We have implemented these two protocols in Java Platform and run it for different number of nodes. From the implementation we have come up with the power optimal route among the nodes and the routing table for each node for both homogeneous and non-homogeneous networks. COMPOW (Common Power) protocol is an asynchronous, distributed and adaptive algorithm for calculating the common optimized power for communication among different nodes. CLUSTERPOW (Cluster Power) protocol is a protocol designed for optimizing the transmit power and establish efficient clustering and routing in non-homogeneous networks.