Estimation from Pairwise Comparisons: Sharp Minimax Bounds with Topology Dependence