It should work for any directed graph whether it's acyclic or not. The analogue of VertexOutComponent[] for undirected graphs is ConnectedComponents[].

Note: As is, this works for cases where the vertex list is a range of contigous integers. For a general graph g where vertex list is an arbitrary set, one can work with the set of vertex indices VertexIndex[g,#]&/@VertexList[g].

How to find all vertices reachable from a given start vertex following directed edges, in a cyclic directed graph given as Graph[{v1, v2, ...}, {v1 -> v11, v1 -> v12, ..., v2 -> v21, v2 -> v21, ..., vn -> vn1, vn -> vn2, ...}] where all

My friend and I are creating a walking network, and we have been having issues getting the routing to work. We just realized that the reason why our routes are messed up is because we snapped our routes to edges as well as endpoints. The routing work

I have a Weighted Graph of g which looks like this. vertex = {a, b, c, d, e} SeedRandom[1] g = Graph[#[[1]] -> #[[2]] & /@ Permutations[vertex, {2}], VertexLabels -> Placed["Name", Center], VertexSize -> 0.3, EdgeWeight -> Random

I want to change my text direction based on language. Everything worked fine when it is LTR but as soon as it is switched to RTL then there are two vertical scrollbars in codemirror's textarea. When I remove the overflow-y: scroll then my mouse scrol

I am processing MRP data, with BOM relations as pairs of part number strings. I want to construct lists that represent the linear graphs defined by these pairs. Here is some code to generate random sample data, with real-world distribution of lengths

Counting the amount of triangles in a picture is a task commonly used in brain tests. You are given a picture that contains shapes consisting of triangles. You then must find all possible triangles in the picture. Task You are given a list of lines i

I made a simple teapot with the "Create Standard Primitives" option and exported it as a collada file, ended up with this: < float_array id="Teapot001-POSITION-array" count="1590"> < float_array id="Teapot001-No

The built-in FindShortestPath and GraphDistance functions find the shortest path between two particular vertices in a graph. I can't think of a simple way to finding all shortest paths between two vertices. Any ideas? My graph has weighted edges and

If I have a directed graph, how can I draw it with arrows pointing vertically from bottom to top, like showing a class inheritance pattern in OOP(object oriented programming)? --------------Solutions------------- You'll need to use LayeredGraphPlot.

I'm new here, so forgive me if this question is not well-posed/duplicates an earlier question - although I've searched for similar questions without success. I'm trying to present a plot of connections between elements (correlations between student p

I am working on my first 3D game, for iphone, and I am using Blender to create models, Cocos3D game engine and Bullet for physics simulation. I am trying to learn the use of physics engine. What I have done I have created a small model in blender whi

MSDN specifies (link) that when using triangleadj type of input to the GS, it should provide me with 6 vertices in specific order: 1st vertex of the triangle processed, vertex of an adjacent triangle, 2nd vertex of the triangle processed, another ver

Consider the following code that produces vertices on a line. \documentclass[12pt,a4paper]{article} \usepackage{tkz-graph} \begin{document} \begin{figure} \begin{tikzpicture} \GraphInit[vstyle=Classic] \tikzset{VertexStyle/.append style = {minimum si

I was looking at a video of a system that extrudes meshes along a curve, connecting them end to end but adjusting the vertices for a smooth connection. It does this with a mesh that as far as I know is guaranteed to have open ends that are later capp

A similar question is here. If we give all the data of the vertices's coordinates and the graph's adjacency matrix, how to plot it with tikz, pstrick or other tool in tex? here are the data of adjacency matrix and coordinates Coordinates:{{0.809,0.58

Using Combinatorica, it was possible to generate unlabeled (non-isomorphic) directed graphs of $|V|=n$. Here the example is for $n=4$: Needs["Combinatorica`"] ShowGraph /@ ListGraphs[4,Directed]; Using GraphData, I know how to generate undirecte

Suppose I have an undirected graph G = Graph[{1 <-> 2, 2 <-> 3, 2 <-> 3, 3 <-> 4}] I used FindPath[G,1,4,Infinity,All] and obtained the result {{1, 2, 3, 4}} But the expected result is {{1, 2, 3, 4}, {1, 2, 3, 4}} Is there any way

I have just started learning graph algorithms and am trying to arrive at an ideal interface. I understand that this code will not be used anywhere else (I will certainly use Boost::Graph) but I just want to make sure that what I am writing is not com

I'm given a directed graph with weights assigned to vertices, not edges. My goal is to find the maximal weight of a path in this graph. A path's weight is a sum of weights of all unique vertices it contains. A vertex may be visited multiple times on

Refer to the following fiddle: https://jsfiddle.net/537w3qsn/ Here's what I want: The header and footer should remain visible on the page at all times. The body (green div in the middle) should get a vertical scrollbar if it would otherwise cause con