def reinforce_branches_overloading(network, crit_lines):
    """
    Reinforce MV or LV grid due to overloading.
    
    Parameters
    ----------
    network : :class:`~.grid.network.Network`
    crit_lines : :pandas:`pandas.DataFrame<dataframe>`
        Dataframe containing over-loaded lines, their maximum relative
        over-loading and the corresponding time step.
        Index of the dataframe are the over-loaded lines of type
        :class:`~.grid.components.Line`. Columns are 'max_rel_overload'
        containing the maximum relative over-loading as float and 'time_index'
        containing the corresponding time step the over-loading occured in as
        :pandas:`pandas.Timestamp<timestamp>`.

    Returns
    -------
    Dictionary with :class:`~.grid.components.Line` and the number of Lines
    added.
        
    Notes
    -----
    Reinforce measures:

    1. Install parallel line of the same type as the existing line (Only if
       line is a cable, not an overhead line. Otherwise a standard equipment
       cable is installed right away.)
    2. Remove old line and install as many parallel standard lines as
       needed.

    """

    # load standard line data
    try:
        standard_line_lv = network.equipment_data['lv_cables'].loc[
            network.config['grid_expansion_standard_equipment']['lv_line']]
    except KeyError:
        print('Chosen standard LV line is not in equipment list.')
    try:
        standard_line_mv = network.equipment_data['mv_cables'].loc[
            network.config['grid_expansion_standard_equipment']['mv_line']]
    except KeyError:
        print('Chosen standard MV line is not in equipment list.')

    lines_changes = {}
    for crit_line in crit_lines.index:
        rel_overload = crit_lines.max_rel_overload[crit_line]
        # check if line is in LV or MV and set standard line accordingly
        if isinstance(crit_line.grid, LVGrid):
            standard_line = standard_line_lv
        else:
            standard_line = standard_line_mv

        if crit_line.type.name == standard_line.name:
            # check how many parallel standard lines are needed
            number_parallel_lines = math.ceil(
                rel_overload * crit_line.quantity)
            lines_changes[crit_line] = (number_parallel_lines -
                                        crit_line.quantity)
            crit_line.quantity = number_parallel_lines
        else:
            # check if parallel line of the same kind is sufficient
            if (crit_line.quantity == 1 and rel_overload <= 2
                    and crit_line.kind == 'cable'):
                crit_line.quantity = 2
                lines_changes[crit_line] = 1
            else:
                number_parallel_lines = math.ceil(
                    crit_line.type['I_max_th'] * rel_overload /
                    standard_line['I_max_th'])
                lines_changes[crit_line] = number_parallel_lines
                crit_line.type = standard_line.copy()
                crit_line.quantity = number_parallel_lines
                crit_line.kind = 'cable'

    if not crit_lines.empty:
        logger.debug('==> {} branche(s) was/were reinforced '.format(
            crit_lines.shape[0]) + 'due to over-loading issues.')

    return lines_changes