Optimal and Near-Optimal solutions for 3D Structure Comparisons