As I have learned it, a proper game ending (if it is not resigned) requires closing all neutral points (see Dame, Teire) – i.e. all points between my and my opponent’s borders.
Any algorithm that interferes with this should be met with salt water and iron fillings.