Determining the Optimal Layout