def accumulate_demand_sequence(demand_sequence: list) -> dict:
    """
    :param demand_sequence: a list of tuples with [(src, dst, demand_size)]
    :return demand_matrix: accumulated demand matrix with {(src, dst) :  demand_size}
    """
    demand_matrix = dict()
    for src, dst, demand_size in demand_sequence:
        if (src, dst) not in demand_matrix:
            demand_matrix[(src, dst)] = 0

        demand_matrix[(src, dst)] += demand_size
    return demand_matrix