def exclude_nodes_from_states(traj_states, nodes_exluded=None):
    """Exclude nodes from states
    :param traj_states: list of states (each state is a liste of nodes)
    :param nodes_exluded: list/set of nodes to remove
    """
    if not nodes_exluded or len(nodes_exluded) <= 0:
        return traj_states
    traj_states_ret = []
    for one_traj_states in traj_states:
        new_traj_states = list(set(one_traj_states) - set(nodes_exluded))
        if len(new_traj_states) <= 0:
            new_traj_states = ['<nil>']
        traj_states_ret.append(new_traj_states)
    return traj_states_ret
