The heap is an efficient implementation of the priority queue. It is currently used by $scheduler and $graph. When you use it only in assignment calls (list = $heap.method(args), in other words), it will operate in the logarithmic time (very fast).
Heap is a list with the property that i-th element of the list has lower priority than either 2*i-th and 2*i+1-st element of the list. Obviously, the first element of the list will have the lowest priority.
Both methods assume that their first argument already is a heap.