The most costly operation in the oil exploration is the well network drilling. One of the most effective ways to reduce the cost of drilling networks is decreasing the number of the required wells by selecting the optimum situation of the rig placement. In this paper, Balas algorithm is used as a model for optimizing the cost function in oil well network, where the vertical and directional drilling is performed. The model can determine optimal well placement as well as optimal paths to develop the field. The proposed model is implemented in an Iran southern gas field with five drilling rigs used to drill 44 wells from 14 positions on the surface. The results show a 17.4% reduction compared to the proposed cost.