| 44 | using namespace SpanningTreeClustering; |
| 45 | |
| 46 | bool EdgeLess(const Edge* a, const Edge* b) |
| 47 | { |
| 48 | if (a->length < b->length) { |
| 49 | return true; |
| 50 | } else if (a->length > b->length ) { |
| 51 | return false; |
| 52 | } else if (a->orig->id < b->orig->id) { |
| 53 | return true; |
| 54 | } else if (a->orig->id > b->orig->id) { |
| 55 | return false; |
| 56 | } else if (a->dest->id < b->dest->id) { |
| 57 | return true; |
| 58 | } else if (a->dest->id > b->dest->id) { |
| 59 | return false; |
| 60 | } |
| 61 | return true; |
| 62 | } |
| 63 | |
| 64 | /* This function takes last element as pivot, places |
| 65 | the pivot element at its correct position in sorted |