def _priority_connection(priority_route:dict, cost_matrix, mean_routes, std_routes, mean_weight, std_weigth, distance_weight) -> dict:
    """
Give us the priority connections dictionary for each route

Parameters
-----------

priority_route: dict
    The dictionary with the priority routes

cost_matrix: dict of dicts
    it's a dict of dicts with the points to visit as a keys and
    the value is another dictionary with the points to visit and
    the value of going for the first point to the second. It's a
    dictionary representation of a matrix.

mean_routes: dict
    A dict with the mean distance/cost of all points one each other

std_routes: dict
    A dict with the standar deviation distance/cost of all points one each other

mean_weight: float
    The ponderation of the mean for all points, higher number make points
    with higher mean (more distance from others) have large values and priorice
    their connections

std_weight: float
    The ponderation of the standar deviation for all points, higher number
    make points with higher deviation (more diferents of distance between points)
    have larger values and priorice their connections

distance_weight: float
    The ponderation of the distance between all points, higher distance_weight 
    make points with higher distances between them have large values

Return
-------
A dict of dicts every point connections ordered by priority
    """



    dict_prior_connections_ordered = {}
    base_order = priority_route.keys()
    for id_route in base_order:
        prior_connections = {}
        for given_route in base_order:
            if id_route != given_route:
                prior_connections[given_route] = ((mean_routes[given_route]**mean_weight) * (std_routes[given_route]**std_weigth)) /  cost_matrix[given_route][id_route] ** distance_weight
        dict_prior_connections_ordered[id_route] = dict(sorted(prior_connections.items(), reverse=True, key=lambda x: x[1]))
    return dict_prior_connections_ordered