The Physical Systems Behind Optimization Algorithms