Skip to content

Add shell infrastructure for Herings-Peeters (2001) solver - #967

Merged
tturocy merged 5 commits into
gambitproject:feature/hpfrom
AndresFerCervell:feature/hp_first_steps
Jul 3, 2026
Merged

Add shell infrastructure for Herings-Peeters (2001) solver#967
tturocy merged 5 commits into
gambitproject:feature/hpfrom
AndresFerCervell:feature/hp_first_steps

Conversation

@AndresFerCervell

Copy link
Copy Markdown
Contributor

Issues closed by this PR

Description of the changes in this PR

This PR implements the basic shell infrastructure for a new Nash equilibrium solver based on the differentiable homotopy method by Herings and Peeters (2001).

Changes included:

  • C++ Layer (src/solvers/hp/): Created hp.h and hp.cc, currently initializes a StrategySupportProfile and returns a trivial uniform mixed strategy profile.
  • Cython Layer (src/pygambit/): Added external C++ declarations to gambit.pxd under the Gambit namespace, and implemented the _hp_strategy_solve translation function inside nash.pxi.
  • Python Layer (src/pygambit/nash.py): Exposed the high-level hp_solve function to end-users.
  • Build System: Updated setup.py and updated Makefile.am for general consistency.
  • Documentation (doc/references.bib): Added the canonical BibTeX entry for Herings & Peeters (2001) under the articles_equilibria category. Documentation will be expanded throughthe creation of the algorithm.

How to review this PR

-Ensure the project compiles succesfully.
-Verify that running the solver from a Python console returns the expected trivial profile.
-Check that the internal naming schemas adhere to Gambit´s established conventions for strategic form solvers.

@tturocy tturocy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The initial setup looks good.

We should consider how to organise this. I am thinking we will set up a long-running branch for development of this (separate from master) and then do PRs against that branch. That way we can keep locking in logical steps of progress without winding up with a single huge PR to resolve down the line.

Comment thread src/solvers/hp/hp.cc Outdated
#include "solvers/hp/hp.h"

namespace Gambit {
std::list<MixedStrategyProfile<double>> HPStrategySolveWrapper(const Game &p_game)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just call this HPStrategySolve (but see separate comments on naming)

Comment thread Makefile.am Outdated
contrib/games/yamamoto.nfg \
contrib/games/zero.nfg \
src/README.rst \
src/solvers/hp/hp.cc \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we should add a new group of files to parallel the other solvers. EXTRA_DIST is by convention for non-source-code files; these should be in a <something>_SOURCES declaration.

We don't need to write the C++ driver (as discussed, as this will be obsoleted in 17.0), but still will want to group the files required for each method.

@tturocy

tturocy commented Jul 1, 2026

Copy link
Copy Markdown
Member

@rahulsavani @d-kad For thought/discussion: What should we call this method? We have not added new methods for quite some time. There are several more we are planning to add.

In the past we have avoided referring to methods by author names. However, all methods had a reasonably natural naming in terms of their method. Possibly the exception would be simpdiv, which is indeed a simplicial subdivision method but not necessarily (?) the unique possibility for such a method.

Herings-Peeters were indeed the first to publish a differential path-following method implemented as a true path-following method. But as noted H-P is in practice an implementation of Harsanyi-Selten, and Logit QRE likewise pre-dated H-P (although again my formulation of it as path-following came later).

Views are welcomed - for now @AndresFerCervell carry on calling this "HP" and the like while we think about it!

@AndresFerCervell
AndresFerCervell requested a review from tturocy July 1, 2026 14:55
@tturocy
tturocy changed the base branch from master to feature/hp July 3, 2026 08:05
@tturocy
tturocy marked this pull request as ready for review July 3, 2026 08:13
@tturocy
tturocy merged commit 9bd154f into gambitproject:feature/hp Jul 3, 2026
14 checks passed
@tturocy

tturocy commented Jul 3, 2026

Copy link
Copy Markdown
Member

I've created a branch feature/hp in the main repository which we'll use as the base for work on this over the coming weeks. That will help keep it insulated from other planned changes which will be underway on master once we release 16.7.

@AndresFerCervell
AndresFerCervell deleted the feature/hp_first_steps branch July 3, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants