user3803721 user3803721 - 9 days ago 6
Python Question

Removing Dominated Strategies in Strategic Game

The Problem

I'm using Gambit's Python API to create a game tree. I have game tree with strategies and I want to reduce my tree by eliminating all strictly dominated strategies. 2 Reasons why I am not doing this in the Gambit UI is: sometimes my tree is too big for it and it won't let me save a tree that's been trimmed of dominated strategies, which annoys me.

Anyways, I call this to get me the undominated strategies:

undominated = g.support_profile().undominated()

Failed attempt #1:

I want to remove all the strategies NOT in this list from my game (i.e. remove all dominated strategies in the game). (IS THIS WHAT I WANT EVEN? AM I ALSO REMOVING WEAKLY DOMINATED STRATEGIES?) So I call:

for strategy in g.support_profile():
if strategy not in undominated:

However, I think this leaves my list unchanged... (I expected to remove ~200 and remain with 3 strategies, yet I still had my ~200 strategies).

What could I possibly be doing incorrectly?

Failed attempt #2:

I want to create a NEW game with all my undominated strategies. However, if I create a new game called "h" with my players, I want to try adding these strategies to my new game (unorthodox, but I thought of giving it a shot).

for strategy in undominated:

AttributeError: 'gambit.lib.libgambit.GameStrategies'
object has no attribute 'add'

which confuses me because I thought this was a Strategies object as mentioned here:


Can someone PLEASE help me figure out what I am supposed to do here?


I posted the issue here and it looks like it was solved.


I posted the issue here and it looks like it was solved.