Optimal Design Theory and Algorithms