In this paper we investigate optimization of synchronization cost in undirected dynamical networks. To do so, proper weights are assigned to the networks’ edges considering node and edge betweenness centrality measures. The proposed method gives near-optimal results with less complexity of computation compared to the optimal method, i.e. the method based on convex optimization. This property enables us to apply the method to large networks. Through numerical simulations on scale-free and small-world networks of different size and topological properties we give evidence that the performance of the proposed method is much better than another heuristic method; namely the Metropolis-Hasting algorithm. This procedure has potential application in many engineering problems where the synchronization of the network is required to be achieved by minimal cost.