PriorithizedVertexBuffer Optimization

Topics: algorithm
Apr 23, 2008 at 9:14 AM
I optimized the PriorithizedVertexBuffer a little since it took minitues to complete on my machine for very large graphs.
I reduced the calls to sort to a minum which resulted in rediced execution duration of a few seconds.

public void Update(TVertex v)
// remove from old position
bool removed = base.Remove(v);

// re- Add

public new void Push(TVertex v)
// find location to insert
int index = this.BinarySearch(v, this.comparer);
System.Diagnostics.Debug.Assert(index < 0);
// add to queue
base.Insert(~index, v);
* */
Aug 30, 2008 at 11:17 PM
I've rewritten the priorithizedvertexbuffer (now PrioirityQueue) using a binary heap. Performance shoud be significantly faster.