private Circuits calculateCircuitsAsync(TaskMonitor monitor) {

		Circuits result = new Circuits();

		monitor.setMessage("Finding all loops");

		Set<Set<V>> strongs = GraphAlgorithms.getStronglyConnectedComponents(graph);

		for (Set<V> vertices : strongs) {
			if (monitor.isCancelled()) {
				return result;
			}

			if (vertices.size() == 1) {
				continue;
			}

			GDirectedGraph<V, E> subGraph = GraphAlgorithms.createSubGraph(graph, vertices);

			Collection<E> edges = subGraph.getEdges();
			result.allCircuits.addAll(edges);

			HashSet<E> asSet = new HashSet<>(edges);
			Collection<V> subVertices = subGraph.getVertices();
			for (V v : subVertices) {
				if (monitor.isCancelled()) {
					return result;
				}
				result.circuitsByVertex.put(v, asSet);
			}
		}

		result.complete = true;
		return result;
	}
Signals to this path highlighter that it should stop all background jobs
Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/edge/VisualGraphPathHighlighter.java