The algorithm has never been published.
It's pretty sophisticated, and it clearly takes into account cruise efficiency (it works on ridges...) and average climb rate. It does, however, have a tendency to bring you home early if things are going well. Unless the day is falling apart, I will typically press into the last turn area until CN tells me I'm going to be at least 5, usually more like 10 minutes over. Much better to be 3 -4 minutes over than even 30s under.