Original Post
This is my compare function for my heap commands, std::make_heap, etc. bool compareDist(Vertex * a, Vertex * b) { return (a->getDist() < b->getDist()); } and its used in here: make_heap(vertexVector.begin(), vertexVector.end(), compareDist); It should sort the Vertex pointers in my heap by their getDist() values, but instead its almost random. Heres the output of vertexVector before running make_heap: (the format is: vertexnumber=dist) 1=2147483647 2=1 3=21 4=2147483647 5=2147483647 6=2147483647 7=2147483647 And after and running make_heap: 7=2147483647 5=2147483647 6=2147483647 4=2147483647 2=1 1=2147483647 3=21 I tried sort_heap too: 2=1 4=2147483647 5=2147483647 7=2147483647 6=2147483647 3=21 1=2147483647 Thanks for any help