Optimization via game theoretic control