Using an AF-heap, a graph having m edges can be inserted into an empty graph of n vertices. The algorithm works with an efficiency of O(m + n log n).