Reimplementing algorithm from GPL program
So it's not impossible for them to absorb the changes in a roundabout way.
If you are literally translating the C++ code that implements the algorithm, then you are creating a derived work of apt and you must license your code under the GPL as well.
On the other hand, if you implement the algorithm based on a textual/mathematical description of the algorithm without looking at the C++ implementation, then your code is not a derived work and you are free to choose your license as you wish.
If you don't translate the C++ code, but you do look at it, then you are in a legal grey area. In that case, it is not entirely clear if your code will be considered a derived work or an independent implementation of the algorithm. To be on the safe side, you can best regard it as a derived work.
The difference exists because algorithms themselves are not subject to copyright, but their implementations are.
So it's not impossible for them to absorb the changes in a roundabout way.