  A recently proposed dimensional reduction approach for studying
synchronization in the Kuramoto model is employed to build optimal network
topologies to favor or to suppress synchronization. The approach is based in
the introduction of a collective coordinate for the time evolution of the phase
locked oscillators, in the spirit of the Ott-Antonsen ansatz. We show that the
optimal synchronization of a Kuramoto network demands the maximization of the
quadratic function $\omega^T L \omega$, where $\omega$ stands for the vector of
the natural frequencies of the oscillators, and $L$ for the network Laplacian
matrix. Many recently obtained numerical results can be re-obtained
analytically and in a simpler way from our maximization condition. A
computationally efficient {hill climb} rewiring algorithm is proposed to
generate networks with optimal synchronization properties. Our approach can be
easily adapted to the case of the Kuramoto models with both attractive and
repulsive interactions, and again many recent numerical results can be
rederived in a simpler and clearer analytical manner.
