This 10-hour seminar for PhD students covers two complementary ways of using AI to optimize networks. Day 1 is about learning a policy online, on the system: multi-armed and contextual bandits, safe Bayesian online learning under constraints, and reinforcement learning, illustrated with vRAN and edge orchestration case studies (vrAIn, BP-vRAN, EdgeBOL, AegisRAN). Day 2 is about generating an auditable heuristic offline, with Large Language Models inside an evolutionary loop: FunSearch, Evolution of Heuristics (EoH), ReEvo, CALM, AlphaEvolve and systems use cases.