@Override
		public Collection<CollatzEdge> getOutEdges(Integer v) {
			Set<CollatzEdge> result = new HashSet<>();
			int r = v * 2;
			if (r >= 0) {
				result.add(new CollatzEdge(v, CollatzOp.INV_DIV2, v * 2));
			}
			r = v * v;
			if (r >= 0) {
				result.add(new CollatzEdge(v, CollatzOp.SQR, v * v));
			}
			r = v - 1;
			if (r % 3 == 0) {
				result.add(new CollatzEdge(v, CollatzOp.INV_MUL3_ADD1, r / 3));
			}
			return result;
		}
A silly infinite graph based loosely on the Collatz conjecture
Ghidra/Framework/Graph/src/test/java/ghidra/graph/DijkstraShortestPathsAlgorithmTest.java