Theory and Algorithm of Local-Refinement-Based Optimization with Application to Device and Interconnect Sizing