Contraction Hierachies needs patch for 26.04

@AuBousquet

Hello,
We are doing:

  • bump up boost graph min requirement (no problem here)
  • Testing on ubuntu-26.06 on CI

On ubuntu-latest there is no problem, but on ubuntu-26.04 the contraction hierarchies code is generating a segmentation fault, and crashing the server.

The problem is when its the last vertex that is been processed:

You can not compare with top on an empty queue

My intended patch is not working (aka the expected results do not come out right). As you can see I am attepting to do a special case when after the last pop happens, then the priority queue is empty, so a special process has to be done.

if (minPQ.empty()) {
    std::pair< int64_t, typename G::V > contracted_vertex;
    contracted_vertex.first = 0;
    contracted_vertex.second = ordered_vertex.second;
    priority_queue.push(contracted_vertex);
    break;
}

I will try guard that code, when ubuntu 26.04 is been used, then use the patch, otherwise its not crashing the server and its getting the expected results.

If you can have a look, I will appriciate.

@AuBousquet

Forgot to put a link about the server crash

@AuBousquet
Never mind I refined the guard, and now its ok

@cvvergara

Hello,

I do not have anything to do, finally ?

No, I Fixed

The problem was when accessing the top of an empty queue.
So I removed the offending line of the log
and added a variable that checks for empty and gives a value of -1 when its empty.
that way line 278 will not have a problem.

All tests passed with t hat modification :slight_smile:

Regards
Vicky