Optimal Layout Synthesis for Quantum Computing