Do you mean creating a duplicate of a root asset graph along with duplicates of all sub-graphs instead of references to them?
If so, here is a NON tested way to do so recursively that should work. Commented code following:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
publicGraph DeepCopy(Graph original){
//create a duplicate asset of provided original. Maybe show file selection dialog?
varcopy=//your editor method to do so, like AssetDatabase.CreateAsset.
//make use of IGraphAssignable interface to find nodes that represent a sub-graph.