def links
    agent_ids = agents.map(&:id)

    contained_links = agents.map.with_index do |agent, index|
      agent.links_as_source.where(receiver_id: agent_ids).map do |link|