The problem of minimizing the total network cost of an optical network topology by efficient selection of switching sites, size of optical switches, and optical links is investigated in this paper. The problem investigated is NP hard. Therefore, we develop an efficient heuristic to approximate the solution in polynomial time. A mixed integer quadratic programming (MIQP) formulation of the problem is also presented to find the optimal network cost and compute the efficiency of the heuristic. The total network cost calculated by the heuristic in the experiments is within 19% of its optimal value. Moreover, the total network cost in half of the test problems is within 6% of its optimal value. The heuristic solves the problem with 20 node topologies in less than a second. However, the commercial optimization software can not solve any problem with more than 10 nodes even in two weeks.