@@ -436,9 +436,9 @@ def is_dominated(self, action, tol=None, method=None):
436
436
method : str, optional(default=None)
437
437
If None, `lemke_howson` from `quantecon.game_theory` is used
438
438
to solve for a Nash equilibrium of an auxiliary zero-sum
439
- game. If `method` is set to `'simplex'` or
440
- `'interior-point '`, `scipy.optimize.linprog` is used with
441
- the method as specified by `method`.
439
+ game. If `method` is set to `'simplex'`, `'interior-point'`,
440
+ or `'revised simplex '`, then `scipy.optimize.linprog` is
441
+ used with the method as specified by `method`.
442
442
443
443
Returns
444
444
-------
@@ -469,20 +469,21 @@ def is_dominated(self, action, tol=None, method=None):
469
469
g_zero_sum = NormalFormGame ([Player (D ), Player (- D .T )])
470
470
NE = lemke_howson (g_zero_sum )
471
471
return NE [0 ] @ D @ NE [1 ] > tol
472
- elif method in ['simplex' , 'interior-point' ]:
472
+ elif method in ['simplex' , 'interior-point' , 'revised simplex' ]:
473
473
from scipy .optimize import linprog
474
474
m , n = D .shape
475
- A = np .empty ((n + 2 , m + 1 ))
476
- A [: n , :m ] = - D .T
477
- A [: n , - 1 ] = 1 # Slack variable
478
- A [ n , : m ], A [ n + 1 , : m ] = 1 , - 1 # Equality constraint
479
- A [ n :, - 1 ] = 0
480
- b = np . empty ( n + 2 )
481
- b [: n ] = 0
482
- b [ n ], b [ n + 1 ] = 1 , - 1
475
+ A_ub = np .empty ((n , m + 1 ))
476
+ A_ub [: , :m ] = - D .T
477
+ A_ub [: , - 1 ] = 1 # Slack variable
478
+ b_ub = np . zeros ( n )
479
+ A_eq = np . empty (( 1 , m + 1 ))
480
+ A_eq [:, : m ] = 1 # Equality constraint
481
+ A_eq [:, - 1 ] = 0
482
+ b_eq = np . ones ( 1 )
483
483
c = np .zeros (m + 1 )
484
484
c [- 1 ] = - 1
485
- res = linprog (c , A_ub = A , b_ub = b , method = method )
485
+ res = linprog (c , A_ub = A_ub , b_ub = b_ub , A_eq = A_eq , b_eq = b_eq ,
486
+ method = method )
486
487
if res .success :
487
488
return res .x [- 1 ] > tol
488
489
elif res .status == 2 : # infeasible
@@ -507,9 +508,9 @@ def dominated_actions(self, tol=None, method=None):
507
508
method : str, optional(default=None)
508
509
If None, `lemke_howson` from `quantecon.game_theory` is used
509
510
to solve for a Nash equilibrium of an auxiliary zero-sum
510
- game. If `method` is set to `'simplex'` or
511
- `'interior-point '`, `scipy.optimize.linprog` is used with
512
- the method as specified by `method`.
511
+ game. If `method` is set to `'simplex'`, `'interior-point'`,
512
+ or `'revised simplex '`, then `scipy.optimize.linprog` is
513
+ used with the method as specified by `method`.
513
514
514
515
Returns
515
516
-------
0 commit comments