http://www.perlmonks.org?node_id=661107


in reply to Re^2: Efficient partial deep cloning
in thread Efficient partial deep cloning

Can't you use something like the reference of the current "thing" and the "thing" to be considered to be copied as a key in a hashset? Everytime you encounter those two things in that relationsip, process it once and only once?

Or.. create an algorithm to do a breadth first search (can be less memory intense) to discover all edges and copy them in a graph?