def edge_to_agg_links(k):
    """
    Generate the links between the edge and aggregation switches in each pod.
    Consists of k^3 links.

    :param k: k of the k-fat-tree (i.e., number of pods)

    :return: Edge-to-aggregation links
    """
    links = []
    for pod in range(k):
        for edge in range(int(k/2)):
            from_id = pod * int(k/2) + edge
            for agg in range(int(k/2)):
                to_id = int(k*k/2) + pod * int(k/2) + agg
                links.append((from_id, to_id))
    return links