from typing import List
from typing import Tuple
from typing import Dict


def _evaluate_edge_sequence (edge_seq : List[Tuple[int,int]], distances : Dict[int, Dict[int, int]]) -> int:
    """
    This method evaluates the cost of a solution (i.e. sequence of picking positions) when
    formalised as a sequence of edges (i.e. tuples) as assumed by Zhong.

    :param edge_seq: The edge sequence formalised according to Zhong.
    :param distances: The distance matrix.
    :return: The cost of the solution.

    """
    return sum (distances[i][j] for i, j in edge_seq)