private void generateGraph() {

		AttributedVertex A = vertex("A");
		AttributedVertex B = vertex("B");
		AttributedVertex C = vertex("C");
		AttributedVertex D = vertex("D");

		edge(A, B);
		edge(A, C);
		edge(B, D);
		edge(C, D);
		edge(D, A);
	}
Example script for creating and displaying a graph in ghidra
Ghidra/Features/Base/ghidra_scripts/ExampleGraphServiceScript.java