public DirectedGraph setDominance() {
		Vertex[] roots = this.getSources();
		int i = 0;

		/* Check to make sure we have only one root.  In setting the dominance
		 on a graph with more than one component, use the function
		 setDominanceForModularGraph which checks to see if each components
		 contains only one root.  Setting dominance for that type of graph takes
		 longer.
		*/

		if (roots.length != 1) {

			if (roots.length > 1) {
				Msg.error(this, "this should not print because it means you have more than 1 root");
			}
			else if (roots.length == 0) {
				Msg.error(this, "You need a root,no root provided");
			}
			else {
				Msg.error(this, "Your number of roots is " + roots.length);
			}

			return null;

		}
		Vertex v = roots[0];
		Vector singlePath = new Vector();
		// set the dominance on a graph
		while (this.hasWhiteChild(v) || !v.equals(roots[0])) {
			v = this.addToPaths(v, singlePath);
			if (!(paths.containsInSomeElement(singlePath))) {
				int j;
				paths.add(i, singlePath);
				singlePath = new Vector();
				for (j = 0; j < ((Vector) paths.elementAt(i)).size(); j++) {
					singlePath.add(j, ((Vector) paths.elementAt(i)).elementAt(j));
				}
				i++;
			}
			this.whitenChildren(v);
			v = this.backTrack(v);
			singlePath.removeElementAt(singlePath.size() - 1);
		}
		return this.getDominanceGraph();
	}
This makes a list of all the paths that are in a graph that terminate
either because of a repeated vertex or hitting a sink. It then calls
getDominanceGraph which gets the dominator for every vertex and builds a
dominance graph.
Ghidra/Framework/Generic/src/main/java/ghidra/util/graph/Dominator.java