private void computeDominance(TaskMonitor monitor) throws CancelledException {

		List<V> list = navigator.getVerticesInPostOrder(mutableGraph);

		Map<V, Integer> map = new HashMap<>();
		for (int i = 0; i < list.size(); i++) {
			map.put(list.get(i), i);
		}

		boolean changed = true;
		while (changed) {
			monitor.checkCancelled();
			changed = false;

			// start 1 from the end so we always have a predecessor
			for (int i = list.size() - 2; i >= 0; i--) {  // process in reverse order
				V b = list.get(i);
				Collection<V> vertices = navigator.getPredecessors(mutableGraph, b);
				Iterator<V> iterator = vertices.iterator();
				V newIdom = null;

				while (iterator.hasNext()) {
					V p = iterator.next();
					if (dominatorMap.containsKey(p)) {
						newIdom = p;
						break;
					}
				}
				if (newIdom == null) {
					throw new AssertException("No processed predecessors found for " + b);
				}
				iterator = vertices.iterator();

				while (iterator.hasNext()) {
					V p = iterator.next();
					if (newIdom.equals(p)) {
						continue;
					}
					if (dominatorMap.containsKey(p)) {
						newIdom = intersect(p, newIdom, map);
					}
				}

				V idom = dominatorMap.get(b);
				if (!newIdom.equals(idom)) {
					V last = dominatorMap.put(b, newIdom);
					dominatedMap.get(newIdom).add(b);
					if (last != null) {
						dominatedMap.get(last).remove(b);
					}
					changed = true;
				}
			}
		}
	}
Constructor.

@param g the graph
@param monitor the monitor
@throws CancelledException if the algorithm is cancelled
@throws IllegalArgumentException if there are no source vertices in the graph
Ghidra/Framework/Graph/src/main/java/ghidra/graph/algo/ChkDominanceAlgorithm.java