Has anyone written a reconnect nodes for all path script?

Hi

Has anyone written a reconnect nodes for all path script?
I think this reconnect nodes function is very useful for me to make a part data from remove overlapped data.

I have millions of Kanji data that have already remove overlapped.
So I would like to reconnect node for all glyphs at one time.

If someone already has this kind of script, I would like to have it.

This is not easy to do. To analyze the paths and to figure out what nodes belong to one stem and should be connected is quite complicated.

If anyone likes the challenge, I would support it.