Find all components reachable from firstNode, add them to 'components'
<p>

@param firstNode start search of SCC at this node
356373
private void strongConnect(int firstNode) {
        final Stack<TarjanState> stateStack = new Stack<>();
        stateStack.push(TarjanState.startState(firstNode));

        // nextState label is equivalent to the function entry point in the recursive Tarjan's algorithm.
        nextState:

        while (!stateStack.empty()) {
            TarjanState state = stateStack.pop();
            final int start = state.start;
            final EdgeIterator iter;

            if (state.isStart()) {
                // We're traversing a new node 'start'.  Set the depth index for this node to the smallest unused index.
                nodeIndex[start] = index;
                nodeLowLink[start] = index;
                index++;
                nodeStack.addLast(start);
                onStack.add(start);

                iter = graph.createEdgeExplorer(edgeFilter).setBaseNode(start);

            } else {
                // We're resuming iteration over the next child of 'start', set lowLink as appropriate.
                iter = state.iter;

                int prevConnectedId = iter.getAdjNode();
                nodeLowLink[start] = Math.min(nodeLowLink[start], nodeLowLink[prevConnectedId]);
            }

            // Each element (excluding the first) in the current component should be able to find
            // a successor with a lower nodeLowLink.
            while (iter.next()) {
                int connectedId = iter.getAdjNode();
                if (ignoreSet.contains(start))
                    continue;

                if (nodeIndex[connectedId] == 0) {
                    // Push resume and start states onto state stack to continue our DFS through the graph after the jump.
                    // Ideally we'd just call strongConnectIterative(connectedId);
                    stateStack.push(TarjanState.resumeState(start, iter));
                    stateStack.push(TarjanState.startState(connectedId));
                    continue nextState;
                } else if (onStack.contains(connectedId)) {
                    nodeLowLink[start] = Math.min(nodeLowLink[start], nodeIndex[connectedId]);
                }
            }

            // If nodeLowLink == nodeIndex, then we are the first element in a component.
            // Add all nodes higher up on nodeStack to this component.
            if (nodeIndex[start] == nodeLowLink[start]) {
                IntArrayList component = new IntArrayList();
                int node;
                while ((node = nodeStack.removeLast()) != start) {
                    component.add(node);
                    onStack.remove(node);
                }
                component.add(start);
                component.trimToSize();
                onStack.remove(start);
                components.add(component);
            }
        }
    }
96603
private AbstractNode findFirstNodeByName(final SecurityContext securityContext, final HttpServletRequest request, final String path) throws FrameworkException {

		final String name = PathHelper.getName(path);

		if (!name.isEmpty()) {

			logger.debug("Requested name: {}", name);

			final Query query                  = StructrApp.getInstance(securityContext).nodeQuery();
			final ConfigurationProvider config = StructrApp.getConfiguration();

			if (!possiblePropertyNamesForEntityResolving.isEmpty()) {

				query.and();
				resolvePossiblePropertyNamesForObjectResolution(config, query, name);
				query.parent();
			}


			final List<AbstractNode> results = Iterables.toList(query.getResultStream());

			logger.debug("{} results", results.size());
			request.setAttribute(POSSIBLE_ENTRY_POINTS_KEY, results);

			return (results.size() > 0 ? (AbstractNode) results.get(0) : null);
		}

		return null;
	}
391026
private Set<String> findReachableNodes(CmsAppCategoryNode rootNode, HashSet<String> reachableNodes) {

        reachableNodes.add(rootNode.getCategory().getId());
        for (CmsAppCategoryNode child : rootNode.getChildren()) {
            findReachableNodes(child, reachableNodes);
        }
        return reachableNodes;
    }
966963
public void findStronglyConnectedComponents(GraphType g, GraphToolkit<GraphType, EdgeType, VertexType> toolkit) {

        // Perform the initial depth first search
        DepthFirstSearch<GraphType, EdgeType, VertexType> initialDFS = new DepthFirstSearch<>(g);
        if (m_vertexChooser != null) {
            initialDFS.setVertexChooser(m_vertexChooser);
        }
        initialDFS.search();

        // Create a transposed graph
        Transpose<GraphType, EdgeType, VertexType> t = new Transpose<>();
        GraphType transpose = t.transpose(g, toolkit);

        // Create a set of vertices in the transposed graph,
        // in descending order of finish time in the initial
        // depth first search.
        VisitationTimeComparator<VertexType> comparator = new VisitationTimeComparator<>(
                initialDFS.getFinishTimeList(), VisitationTimeComparator.DESCENDING);
        Set<VertexType> descendingByFinishTimeSet = new TreeSet<>(comparator);
        Iterator<VertexType> i = transpose.vertexIterator();
        while (i.hasNext()) {
            descendingByFinishTimeSet.add(i.next());
        }

        // Create a SearchTreeBuilder for transposed DFS
        SearchTreeBuilder<VertexType> searchTreeBuilder = new SearchTreeBuilder<>();

        // Now perform a DFS on the transpose, choosing the vertices
        // to visit in the main loop by descending finish time
        final Iterator<VertexType> vertexIter = descendingByFinishTimeSet.iterator();
        DepthFirstSearch<GraphType, EdgeType, VertexType> transposeDFS = new DepthFirstSearch<GraphType, EdgeType, VertexType>(
                transpose) {
            @Override
            protected VertexType getNextSearchTreeRoot() {
                while (vertexIter.hasNext()) {
                    VertexType vertex = vertexIter.next();
                    if (visitMe(vertex)) {
                        return vertex;
                    }
                }
                return null;
            }
        };
        if (m_vertexChooser != null) {
            transposeDFS.setVertexChooser(m_vertexChooser);
        }
        transposeDFS.setSearchTreeCallback(searchTreeBuilder);
        transposeDFS.search();

        // The search tree roots of the second DFS represent the
        // strongly connected components. Note that we call copySearchTree()
        // to make the returned search trees relative to the original
        // graph, not the transposed graph (which would be very confusing).
        Iterator<SearchTree<VertexType>> j = searchTreeBuilder.searchTreeIterator();
        while (j.hasNext()) {
            m_stronglyConnectedSearchTreeList.add(copySearchTree(j.next(), t));
        }
    }
1257314
protected List<NodeInterface> getNodesAt(final NodeInterface locationNode) {

		final List<NodeInterface> nodes = new LinkedList<>();

		for(RelationshipInterface rel : locationNode.getIncomingRelationships(NodeHasLocation.class)) {

			NodeInterface startNode = rel.getSourceNode();

			nodes.add(startNode);

			// add more nodes which are "at" this one
			nodes.addAll(getNodesAt(startNode));
		}

		return nodes;

	}
57695
@Pure
	@SuppressWarnings("checkstyle:nestedifdepth")
	List<AStarNode<ST, PT>> findPath(AStarNode<ST, PT> startPoint, PT endPoint) {
		final CloseComparator<ST, PT> cComparator = new CloseComparator<>();
		final OpenComparator<ST, PT> oComparatorWithoutRef = new OpenComparator<>();
		final List<AStarNode<ST, PT>> openList = new ArrayList<>();
		final List<AStarNode<ST, PT>> closeList = new ArrayList<>();

		openList.add(startPoint);
		fireNodeOpened(startPoint, openList);

		int idx;
		AStarNode<ST, PT> candidate;
		AStarNode<ST, PT> ocandidate;
		AStarNode<ST, PT> reachableCandidate;
		AStarNode<ST, PT> reachedCandidate;
		PT reachableNode;
		PT node;
		double gCost;
		double h1;
		boolean foundTarget = false;

		while (!foundTarget && !openList.isEmpty()) {

			ocandidate = openList.remove(0);
			fireNodeConsumed(ocandidate, openList);

			candidate = translateCandidate(endPoint, ocandidate);
			foundTarget = candidate == null;

			if (!foundTarget) {
				assert candidate != null;
				node = candidate.getGraphPoint();
				// Update the nodes that are reachable from the current candidate.
				for (final ST segment : candidate.getGraphSegments()) {
					reachableNode = segment.getOtherSidePoint(node);
					if (reachableNode != null && !reachableNode.equals(node)) {
						gCost = candidate.getCost()
								+ computeCostFor(node)
								+ computeCostFor(segment);
						h1 = estimate(reachableNode, endPoint);
						reachableCandidate = newAStarNode(reachableNode, gCost, h1, segment);

						// Reopen node if better cost
						idx = (isClosedNodeReopeningEnabled())
								? ListUtil.indexOf(closeList, cComparator, reachableCandidate)
										: -1;
						if (idx >= 0) {
							reachedCandidate = closeList.get(idx);
							if (gCost < reachedCandidate.getCost()) {
								closeList.remove(idx);
								final AStarNode<ST, PT> nn = node(
										reachableNode,
										gCost,
										h1,
										segment);
								ListUtil.add(
										openList,
										oComparatorWithoutRef,
										nn,
										true, false);
								fireNodeOpened(nn, openList);
							}
						} else {
							idx = openList.indexOf(reachableCandidate);
							if (idx >= 0) {
								// Rearrange open list if better cost
								reachedCandidate = openList.get(idx);
								if ((gCost + h1) < reachedCandidate.getPathCost()) {
									openList.remove(idx);
									final AStarNode<ST, PT> nn = node(
											reachableNode,
											gCost,
											h1,
											segment);
									ListUtil.add(openList,
											oComparatorWithoutRef,
											nn,
											true, false);
									fireNodeReopened(nn, openList);
								}
							} else {
								// Node was neither treated nor seen, add it
								final AStarNode<ST, PT> nn = node(
										reachableNode,
										gCost,
										h1,
										segment);
								ListUtil.add(openList,
										oComparatorWithoutRef,
										nn,
										true, false);
								fireNodeOpened(nn, openList);
							}
						}
					}
				}
			}

			// Refresh the close list
			idx = ListUtil.add(closeList, cComparator, ocandidate, false, true);
			fireNodeClosed(ocandidate, closeList);
			assert idx >= 0;
		}

		return closeList;
	}
855847
public static List<CSNodeWrapper> getAllNodes(final ContentSpecWrapper contentSpec) {
        final List<CSNodeWrapper> nodes = new LinkedList<CSNodeWrapper>();
        if (contentSpec.getChildren() != null) {
            final List<CSNodeWrapper> childrenNodes = contentSpec.getChildren().getItems();
            for (final CSNodeWrapper childNode : childrenNodes) {
                nodes.add(childNode);
                nodes.addAll(getAllChildrenNodes(childNode));
            }
        }

        return nodes;
    }
1162868
public Node firstChild() {

		if (currentNode == null)
			return null;

		Node node = getFirstChild(currentNode);

		if (node != null)
			currentNode = node;

		return node;
	}
1261609
final Node<E> succ(Node<E> p) {
        // TODO: should we skip deleted nodes here?
        if (p == (p = p.next))
            p = first();
        return p;
    }
396863
public void addChildren( AstNode first,
                             AstNode second,
                             AstNode third ) {
        if (first != null) {
            this.addLastChild(first);
        }
        if (second != null) {
            this.addLastChild(second);
        }
        if (third != null) {
            this.addLastChild(third);
        }
    }
589590
private void visitList(final ObjectGraphNode node) {
		int index = 0;

		for (Iterator i = ((List) node.getValue()).iterator(); i.hasNext();) {
			Object entry = i.next();
			String entryType = entry == null ? Object.class.getName() : entry.getClass().getName();

			ObjectGraphNode childNode = new ObjectGraphNode(++nodeCount, "[" + index++ + "]",
					entryType, entry);
			node.add(childNode);
			visit(childNode);
		}

		adjustOverhead(node);
	}
362092
@SuppressWarnings("unchecked")
    public static <T extends Node> void findNodes(List<Node> nodes, Class<T> cls, List<T> results) {
        for (Node n : nodes) {
            if (n instanceof ContainerNode) {
                findNodes(((ContainerNode) n).getNodes(), cls, results);
            }

            if (cls == n.getClass()) {
                results.add((T) n);
            }
        }
    }
401381
public void addChildBefore(Node newChild, Node node) {
        if (newChild.next != null)
            throw new RuntimeException(
                      "newChild had siblings in addChildBefore");
        if (first == node) {
            newChild.next = first;
            first = newChild;
            return;
        }
        Node prev = getChildBefore(node);
        addChildAfter(newChild, prev);
    }
233712
static <K extends Comparable<K>> void checkNode(Node<K> node) {
        node.checkNode(null, null);
    }
1276415
private DNode searchFrontendNode() {
        DNode result = DNode.NOT_FOUND;
        
        for (DNode node : nodes) {
            if (node.getFrontend()) {
                result = node;
                break;
            }
        }
        return result;
    }
480286
public void add(final T node) {
        if ( this.firstNode == null ) {
            this.firstNode = node;
            this.lastNode = node;
        } else {
            this.lastNode.setNext( node );
            node.setPrevious( this.lastNode );
            this.lastNode = node;
        }
        this.size++;
    }
1270611
public static Treenode search(Treenode start, String text) {
        return search(start.getTreeview(), text, defaultTreenodeSearch);
    }