In a (possibly directed) graph, is there a simple way to find all nodes reachable for a given node?
I’ve recently started working with MATLAB graphs. In two recent problems, I have graphs which are not known to be connected every node to every other node. Is there a way to determine in one or a known number of steps, the set of nodes which can (or cannot would work) be reached from a specified node? I’ve encountered this question both with undirected (small, and I powered through) and now undirected nodes.
Just in case I’m in asking an XY question, my current directed graph is entirely unidirectional; there are no closed loops. I could trivially assign a value to each node, and know that every edge leads to a node with a strictly larger value than the node it leads from. To be even more specific if it helps, though I definitely don’t know the proper math language: the graph represents a double elimination playoff bracket, and I want to put together the possible routes for each seed on a plot to guide teams through the process, pruning out things that don’t matter to that team. Fortunately in this case, the graph is deterministic; no re-seeding occurs due to match outcomes, making such a plot useful.
My previous issue, which was small so I powered through, had an undirected graph, and I really just wanted to know whether or not the graph was continuous; that is, whether every node pair was connected by some path.I’ve recently started working with MATLAB graphs. In two recent problems, I have graphs which are not known to be connected every node to every other node. Is there a way to determine in one or a known number of steps, the set of nodes which can (or cannot would work) be reached from a specified node? I’ve encountered this question both with undirected (small, and I powered through) and now undirected nodes.
Just in case I’m in asking an XY question, my current directed graph is entirely unidirectional; there are no closed loops. I could trivially assign a value to each node, and know that every edge leads to a node with a strictly larger value than the node it leads from. To be even more specific if it helps, though I definitely don’t know the proper math language: the graph represents a double elimination playoff bracket, and I want to put together the possible routes for each seed on a plot to guide teams through the process, pruning out things that don’t matter to that team. Fortunately in this case, the graph is deterministic; no re-seeding occurs due to match outcomes, making such a plot useful.
My previous issue, which was small so I powered through, had an undirected graph, and I really just wanted to know whether or not the graph was continuous; that is, whether every node pair was connected by some path. I’ve recently started working with MATLAB graphs. In two recent problems, I have graphs which are not known to be connected every node to every other node. Is there a way to determine in one or a known number of steps, the set of nodes which can (or cannot would work) be reached from a specified node? I’ve encountered this question both with undirected (small, and I powered through) and now undirected nodes.
Just in case I’m in asking an XY question, my current directed graph is entirely unidirectional; there are no closed loops. I could trivially assign a value to each node, and know that every edge leads to a node with a strictly larger value than the node it leads from. To be even more specific if it helps, though I definitely don’t know the proper math language: the graph represents a double elimination playoff bracket, and I want to put together the possible routes for each seed on a plot to guide teams through the process, pruning out things that don’t matter to that team. Fortunately in this case, the graph is deterministic; no re-seeding occurs due to match outcomes, making such a plot useful.
My previous issue, which was small so I powered through, had an undirected graph, and I really just wanted to know whether or not the graph was continuous; that is, whether every node pair was connected by some path. graph, connected MATLAB Answers — New Questions