private static FunctionGraph createGraph(Function function, FGController controller,
			TaskMonitor monitor) throws CancelledException {

		BidiMap<CodeBlock, FGVertex> vertices = createVertices(function, controller, monitor);

		Collection<FGEdge> edges = createdEdges(vertices, controller, monitor);

		FunctionGraphVertexAttributes settings =
			new FunctionGraphVertexAttributes(controller.getProgram());
		FunctionGraph graph = new FunctionGraph(function, settings, vertices.values(), edges);

		for (FGVertex vertex : vertices.values()) {
			vertex.setVertexType(getVertexType(graph, vertex));
		}

		return graph;
	}
Creates a new function graph for the given function

@param function the function to graph
@param controller the controller needed by the function graph
@param program the function's program
@param monitor the task monitor
@return the new graph
@throws CancelledException if the task is cancelled via the monitor
Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/graph/FunctionGraphFactory.java