Amortized efficiency of a path retrieval data structure