def evaluate_profits(vrp, **kwargs):
    """
    Evaluates total profits acquired from visiting optional nodes.
    :param vrp: A population individual subject to evaluation.
    :param kwargs: Keyword arguments. The following are expected
    from it:
    - (list<int>) 'node_profit': List of profits that one could get
      from visiting optional nodes.

    :return: Total profits that come from visiting nodes specified
    by given individual.
    """

    node_profit_list = kwargs["node_profit"]
    solution = vrp.solution
    unvisited_optional_nodes = vrp.unvisited_optional_nodes
    profit = 0
    for i in range(len(solution)):
        node = solution[i]
        if node not in unvisited_optional_nodes:
            profit += node_profit_list[node]

    vrp.profits = profit
    return profit