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库,用于计算和设计具有共享约束及实值决策变量的非合作博弈中的广义纳什均衡。该库利用所有参与者的联合Karush-Kuhn-Tucker条件,既能处理一般非线性广义纳什均衡问题,也能处理线性二次博弈及其变分形式。非线性博弈通过非线性最小二乘公式求解,其自动微分功能依赖于JAX实现。线性二次广义纳什均衡问题被重构为混合整数线性规划,从而支持对多重均衡的高效计算。该框架还支持逆博弈与Stackelberg博弈设计问题。NashOpt的功能通过多个示例得到展示,包括线性二次调节与模型预测控制的非合作博弈论控制问题。该库可通过https://github.com/bemporad/nashopt获取。