Nowadays, a lot of smart devices need to be connected to the internet continuously which develops the concept of Internet of Things (IoT). Therefore, there is a high demand for the network traffic and hence, internet service providers (I) should increase their network capacity. In traditional network infrastructure, network management becomes more complicated by network growth since each node has its own control plane and data plane. Software defined networking (SDN) is designed as a powerful infrastructure for future networking. Some of the technical and the practical advantages of SDN are separation of data plane and control plane, control centralization, automation, and virtualization. Using a centralized controller in the control plane of SDN, we are able to monitor and control forwarding devices located in the data plane. Since only one controller would not be adequate to monitor the network, it is necessary to place multiple controllers for the management of large networks. Controller placement problem (CPP) is a new important issue in SDN related researches. This issue consists of two parts: 1) what the minimum number of controllers are and 2) where the best place for each controller is. In this thesis, we propose an algorithm based on the concept of the minimum dominating set in graph theory to find the minimum number of the required controllers and their appropriate places. Then, we cluster nodes based on reducing the average total latency between the switches and their corresponding controllers. Next, a modified version of our algorithm is proposed in order to achieve a smaller average total latency for each controller. Consequently, for variable number of controllers in each network, the best nodes to place controllers are determined in which average total latency is minimized. Finally, we define a cost function based on the average total latency and other variables such as purchase cost and installation cost to find the total cost for any number of controller and the importance of each variable of the cost function. All the proposed algorithms are evaluated on real WAN topologies. For the comparison of the results, we modify an important algorithm in data mining i.e., k-means algorithm to be applicable to these topologies. Next, we compare the results of our proposed algorithms with that of modified k-means algorithm on several topologies. We also compare our results with two similar works. Finally, we limit the capacity of the controllers and then, propose an algorithm to find the minimum dominating set by considering the capacity of controllers. Software Defined Networking (SDN), Controller Placement, Dominating Set, Clustering