Dynamic Potential Games With Constraints: Fundamentals and Applications in Communications