at.jku.ssw
Class VertexPriorityQueue

java.lang.Object
  extended by at.jku.ssw.VertexPriorityQueue

public class VertexPriorityQueue
extends java.lang.Object

An unbounded priority queue for vertices based on a priority heap.


Method Summary
static VertexPriorityQueue createDistancePriorityQueue()
          Creates a priority queue for vertices.
static VertexPriorityQueue createMinWeightPriorityQueue()
          Creates a priority queue for vertices.
 int offer(Vertex vertex)
          Inserts the vertex into this priority queue.
 Vertex poll()
          Retrieves and removes the head vertex of this priority queue.
 void print()
          Prints the vertices in the priority queue.
 int size()
          Returns the number of vertices in this priority queue.
 int upHeap(int pos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createMinWeightPriorityQueue

public static VertexPriorityQueue createMinWeightPriorityQueue()
Creates a priority queue for vertices. The vertices are prioritized by the minWeight field, a lower minWeight value means higher priority.


createDistancePriorityQueue

public static VertexPriorityQueue createDistancePriorityQueue()
Creates a priority queue for vertices. The vertices are prioritized by the distance field, a lower distance value means higher priority.


offer

public int offer(Vertex vertex)
Inserts the vertex into this priority queue.


upHeap

public int upHeap(int pos)

poll

public Vertex poll()
Retrieves and removes the head vertex of this priority queue. NoSuchElementException if this priority queue is empty.


size

public int size()
Returns the number of vertices in this priority queue.


print

public void print()
Prints the vertices in the priority queue.