def cgr_neighbor_function(contact_graph, node, destination,
    current_distance, set_visited, suppressed_contacts, lookahead_time):
    """Neighbor function of CGR used by the Dijkstra algorithm.

     Used to determine feasible direct neigbors of a given node.

    Args:
        contact_graph (ContactGraph): The topology information in the form
            of a contact graph
        node (tuple): The evaluated node in the contact graph node form
            ``(from_node, to_node, from_time, to_time, data_rate)``.
        destination (tuple): The nominal destination node in the form
            ``(destination_id, destination_id, 0, math.inf, math.inf)``
        current_distance (int): Contains the weight of the shortest path
            to the currently investigated node (in ms).
        set_visited (set): Set used for storing the visited flag
            of nodes during the Dijkstra runs. Also used for excluding
            suppressed (physical) nodes.
        suppressed_contacts (list): List of contacts that shall not be
            considered for forwarding (and thus neighbor selection)
        lookahead_time (int): Time value that specifies a time window
            (or rather a maximum time) only in which routes are searched.
            This reduces the time necessary to find a shortest route.

    Returns:
        list: A list of all feasible neighbors with items of the form
        ``(<node_id>, weight)`` with ``<node_id>`` representing a certain
        contact in the contact graph.

    """
    neighbors = []
    set_visited.add(node.from_node)
    for edge in contact_graph.graph[node].successors:
        if edge.to_time <= current_distance:
            break
        if ((lookahead_time is None or edge.from_time < lookahead_time) and
            edge.to_node not in set_visited and edge not in
            suppressed_contacts and edge.to_time > current_distance):
            if edge == destination or edge.from_node != edge.to_node:
                weight = edge.from_time - current_distance
                if weight < 0:
                    weight = 0
                neighbors.append((edge, weight))
    return neighbors
