def transition_data_filtering(trans_df, MIN_VIABLE, HIGHLY_VIABLE):
    """
    Adds filtering variables to the transitions dataframe trans_df (pandas.DataFrame)
    to indicate transitions that are viable, desirable and safe.
    """
    trans_df['sim_category'] = ''
    trans_df.loc[trans_df.similarity <= HIGHLY_VIABLE, 'sim_category'] = 'min_viable'
    trans_df.loc[trans_df.similarity > HIGHLY_VIABLE, 'sim_category'] = 'highly_viable'
    trans_df.loc[trans_df.similarity <= MIN_VIABLE, 'sim_category'] = 'not_viable'
    trans_df['is_viable'] = trans_df['is_jobzone_ok'] & (trans_df['sim_category'] != 'not_viable')
    trans_df['is_desirable'] = trans_df['is_viable'] & trans_df['is_earnings_ok']
    trans_df['is_safe_desirable'] = trans_df['is_desirable'] & trans_df['is_not_high_risk']
    trans_df['is_strictly_safe_desirable'] = trans_df['is_desirable'] & trans_df['is_strictly_safe']
    return trans_df