NashOpt is an open-source Python library for computing and designing generalized Nash equilibria (GNEs) in noncooperative games with shared constraints and real-valued decision variables. The library exploits the joint Karush-Kuhn-Tucker (KKT) conditions of all players to handle both general nonlinear GNEs and linear-quadratic games, including their variational versions. Nonlinear games are solved via nonlinear least-squares formulations, relying on JAX for automatic differentiation. Linear-quadratic GNEs are reformulated as mixed-integer linear programs, enabling efficient computation of multiple equilibria. The framework also supports inverse-game and Stackelberg game-design problems. The capabilities of NashOpt are demonstrated through several examples, including noncooperative game-theoretic control problems of linear quadratic regulation and model predictive control. The library is available at https://github.com/bemporad/nashopt
翻译:纳什优化(NashOpt)是一个开源 Python 库,用于计算和设计具有共享约束和实值决策变量的非合作博弈中的广义纳什均衡。该库利用所有博弈者的联合卡鲁什-库恩-塔克条件,以处理一般非线性 GNEs 和线性二次博弈,包括它们的变分版本。非线性博弈通过非线性最小二乘公式求解,依赖 JAX 进行自动微分。线性二次 GNEs 被重新表述为混合整数线性规划,从而能够高效计算多个均衡。该框架还支持逆博弈和斯塔克尔伯格博弈设计问题。纳什优化的能力通过多个示例得到了展示,包括线性二次调节和模型预测控制的非合作博弈论控制问题。该库可在 https://github.com/bemporad/nashopt 获取。