Computing The Optimal Strategy To Commit To