bool operator < (const node &tmp) const { int p1 = 0, p2 = 0; if(cost > tmp.cost) { p1++; } else { p2++; } if(passed < tmp.passed) { p1++; } else { p2++; } return p1 < p2; }