I’m a little confused as to what you’re trying to achieve
Something like this?
Though on a tree it gives weird results (probably because “nearest” point is always different and it’s a mess):