protected void addPathsTo(Collection<Deque<E>> paths, V prev, Deque<E> soFar) {
			if (prev.equals(source)) { // base case:
				// The path from source to source is empty, and our path from intermediate to
				// destination is actually the path from source to destination. Add it!
				paths.add(new LinkedList<>(soFar));
			}
			else { // inductive case:
				/*
				 * Dijkstra has computed the best inbound edges. Consider each as a prefix to the
				 * current path from intermediate to final destination. Since we assume that path is
				 * an optimal path, and we prefix an optimal inbound edge, the prefixed path is an
				 * optimal path from a new intermediate source (inbound neighbor) to the final
				 * destination. So, just recurse, using the new intermediates.
				 */
				for (E e : bestIns.get(prev)) {
					V nextPrev = e.getStart();
					try (DequePush<?> push = DequePush.push(soFar, e)) {
						addPathsTo(paths, nextPrev, soFar);
					}
				}
			}
		}
Add the shortest paths from source to a given intermediate, continuing along a given path
to the final destination, into the given collection

<p>
This is a recursive method for constructing the shortest paths overall. Assuming the
given path from intermediate to final destination is the shortest, we can show by
induction, the computed paths from source to destination are the shortest.

@param paths a place to store the recovered paths
@param prev the intermediate destination
@param soFar a (shortest) path from intermediate to final destination
Ghidra/Framework/Graph/src/main/java/ghidra/graph/algo/DijkstraShortestPathsAlgorithm.java