def get_max_node(candidates, gr_values, column_prefix=""):
    """Given a set of candidate nodes, and return the one with the 
    highest Gain Ratio.

    Args:
        candidates (list): List of candidate nodes.
        gr_values (dict): Dictionary with column names as keys and 
            the corresponding Gain Ratio values as values.
        column_prefix (str): Prefix of the columns generated by the generator 
            (e.g. "new_link_type_"). Defaults to "".

    Returns:
        str: Name of the node with the highest Gain Ratio in the candidate set.
    """

    max_gr = 0
    max_gr_node = None

    for node in candidates:

        try:

            gr = gr_values[column_prefix+node]

        except:

            gr = gr_values[node]

        if gr > max_gr or (gr == 0 and len(candidates) == 1):

            max_gr = gr
            max_gr_node = node

    return max_gr_node