Skip to content
Andrew Byrd edited this page Dec 17, 2014 · 1 revision

The test case that used to compare the different priority queues have been removed since we now only use the BinHeap. This test case was more of a time-consuming experiment than a test. Here are the figures it used to print out every time it ran:

insert/extract 200000 Integers 10 times
class java.util.PriorityQueue (expected results)
class org.opentripplanner.common.pqueue.PriorityQueueImpl 	time 1.184 sec
class org.opentripplanner.common.pqueue.BinHeap 	time 0.517 sec
class org.opentripplanner.common.pqueue.IntBinHeap 	time 0.396 sec
class org.opentripplanner.common.pqueue.BinHeap 	time 0.529 sec
class org.opentripplanner.common.pqueue.IntBinHeap 	time 0.392 sec

maintain queue at size 200000
class org.opentripplanner.common.pqueue.PriorityQueueImpl time 0.928 sec
class org.opentripplanner.common.pqueue.BinHeap time 0.382 sec
class org.opentripplanner.common.pqueue.IntBinHeap time 0.337 sec
class org.opentripplanner.common.pqueue.BinHeap time 0.368 sec

Originally this comparison included a Fibonacci heap which was something like 10 times slower. It was replaced by the binary heap in an array for reasons that are explained in Chen, Chowdhury, Roche, Ramachandran, and Tong in the RoutingBibliography.

The documentation on this wiki is outdated and should not be used

unless you are intentionally working with legacy versions of OpenTripPlanner. Please consult the current documentation at readthedocs

Clone this wiki locally