@Override
	public FunctionGraph copy() {

		Collection<FGVertex> v = getVertices();
		Collection<FGEdge> e = getEdges();
		FunctionGraph newGraph = new FunctionGraph(getFunction(), getSettings(), v, e);

		FGLayout originalLayout = getLayout();
		FGLayout newLayout = originalLayout.cloneLayout(newGraph);
		newGraph.rootVertex = rootVertex;

		// setSize() must be called after setGraphLayout() due to callbacks performed when 
		// setSize() is called
		newGraph.setGraphLayout(newLayout);
		newLayout.setSize(originalLayout.getSize());

		newGraph.setOptions(getOptions());
		return newGraph;
	}
Creates a copy of the given graph <b>while using the exact vertex and edge instances
used in the original graph</b>.

@return the newly created graph
Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/graph/FunctionGraph.java