# Path: src/nashpy/algorithms/lemke_howson.py
# def shift_tableau(tableau: npt.NDArray, shape: Tuple[int, ...]) -> npt.NDArray:
#     """
#     Shift a tableau to ensure labels of pairs of tableaux coincide
# 
#     Parameters
#     ----------
#     tableau : array
#         a tableau corresponding to a vertex of a polytope.
#     shape : tuple
#         the required shape of the tableau
# 
#     Returns
#     -------
#     array
#         The shifted tableau
#     """
#     return np.append(
#         np.roll(tableau[:, :-1], shape[0], axis=1),
#         np.ones((shape[0], 1)),
#         axis=1,
#     )
# 
# def tableau_to_strategy(
#     tableau: npt.NDArray, basic_labels: Set[int], strategy_labels: Iterable
# ) -> npt.NDArray:
#     """
#     Return a strategy vector from a tableau
# 
#     Parameters
#     ----------
#     tableau : array
#         a tableau corresponding to a vertex of a polytope.
#     basic_labels : set
#         the set of basic labels.
#     strategy_labels : Iterable
#         the set of labels that correspond to strategies.
# 
#     Returns
#     -------
#     array
#         A strategy.
#     """
#     vertex = []
#     for column in strategy_labels:
#         if column in basic_labels:
#             for i, row in enumerate(tableau[:, column]):
#                 if row != 0:
#                     vertex.append(tableau[i, -1] / row)
#         else:
#             vertex.append(0)
#     strategy = np.array(vertex)
#     return strategy / sum(strategy)


from itertools import cycle
from typing import Tuple
from nashpy.integer_pivoting import make_tableau, pivot_tableau_lex
from .lemke_howson import shift_tableau, tableau_to_strategy
import numpy as np
import numpy.typing as npt
        next_slack_variables,
        next_non_basic_variables,
    )

    # keeps track of each tableau's non-basic variables
    next_non_basic_variables.add(entering_label)
    next_non_basic_variables.remove(initial_dropped_label)

    while col_non_basic_variables.union(row_non_basic_variables) != full_labels:
        next_tableau, next_slack_variables, next_non_basic_variables = next(tableaux)

        # the first label is 'entering' in the sense that it will enter the next
        # tableau's set of basic variables
        just_entered_label = entering_label
        entering_label = pivot_tableau_lex(
            next_tableau,
            entering_label,
            next_slack_variables,
            next_non_basic_variables,
        )

        next_non_basic_variables.add(entering_label)
        next_non_basic_variables.remove(just_entered_label)

    row_strategy = tableau_to_strategy(
        row_tableau,
        full_labels - row_non_basic_variables,
        range(A.shape[0]),
    )


# Path: src/nashpy/algorithms/lemke_howson.py
# def shift_tableau(tableau: npt.NDArray, shape: Tuple[int, ...]) -> npt.NDArray:
#     """
#     Shift a tableau to ensure labels of pairs of tableaux coincide
# 
#     Parameters
#     ----------
#     tableau : array
#         a tableau corresponding to a vertex of a polytope.
#     shape : tuple
#         the required shape of the tableau
# 
#     Returns
#     -------
#     array
#         The shifted tableau
#     """
#     return np.append(
#         np.roll(tableau[:, :-1], shape[0], axis=1),
#         np.ones((shape[0], 1)),
#         axis=1,
#     )
# 
# def tableau_to_strategy(
#     tableau: npt.NDArray, basic_labels: Set[int], strategy_labels: Iterable
# ) -> npt.NDArray:
#     """
#     Return a strategy vector from a tableau
# 
#     Parameters
#     ----------
#     tableau : array
#         a tableau corresponding to a vertex of a polytope.
#     basic_labels : set
#         the set of basic labels.
#     strategy_labels : Iterable
#         the set of labels that correspond to strategies.
# 
#     Returns
#     -------
#     array
#         A strategy.
#     """
#     vertex = []
#     for column in strategy_labels:
#         if column in basic_labels:
#             for i, row in enumerate(tableau[:, column]):
#                 if row != 0:
#                     vertex.append(tableau[i, -1] / row)
#         else:
#             vertex.append(0)
#     strategy = np.array(vertex)
#     return strategy / sum(strategy)


# Path: src/nashpy/algorithms/lemke_howson_lex.py
from itertools import cycle
from typing import Tuple
from nashpy.integer_pivoting import make_tableau, pivot_tableau_lex
from .lemke_howson import shift_tableau, tableau_to_strategy
import numpy as np
import numpy.typing as npt

        next_slack_variables,
        next_non_basic_variables,
    )

    # keeps track of each tableau's non-basic variables
    next_non_basic_variables.add(entering_label)
    next_non_basic_variables.remove(initial_dropped_label)

    while col_non_basic_variables.union(row_non_basic_variables) != full_labels:
        next_tableau, next_slack_variables, next_non_basic_variables = next(tableaux)

        # the first label is 'entering' in the sense that it will enter the next
        # tableau's set of basic variables
        just_entered_label = entering_label
        entering_label = pivot_tableau_lex(
            next_tableau,
            entering_label,
            next_slack_variables,
            next_non_basic_variables,
        )

        next_non_basic_variables.add(entering_label)
        next_non_basic_variables.remove(just_entered_label)

    row_strategy = tableau_to_strategy(
        row_tableau,
        full_labels - row_non_basic_variables,
        range(A.shape[0]),
    )


    col_strategy = tableau_to_strategy(