PriorithizedVertexBuffer Optimization

Topics: algorithm
Apr 23, 2008 at 10: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 31, 2008 at 12:17 AM
I've rewritten the priorithizedvertexbuffer (now PrioirityQueue) using a binary heap. Performance shoud be significantly faster.