Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

How to select all ASSOCIATED nodes on a directed graph?

0 votes

From node 6...

Neighborhood: 6, 4, 7, 12

Predecessors: 6, 3, 4

Successors: 6, 7, 12

Is there a way to select the entire right graph by just selecting node 6 alone?  Basically, all the edges that are connected regardless of direction.



asked Feb 7 in Help by anonymous

1 Answer

0 votes

Yes, there is.

Use "Tools" -> "Select Elements" with option "Use These Criteria" on tab "Nodes" marked (make sure this option is not marked for any of the other tabs) and "Select" set to "Neighbors of Selected Nodes" as well as "Maximal Path Distance" set to a large value (if in doubt use the node count of your diagram).

If you want to select the edges of the subgraph instead of the nodes, run "Select Elements" a second time with option "Use These Criteria" on tab "Edges" marked and "Select" set to "Selected Nodes".

answered Feb 7 by thomas.behr [yWorks] (90,600 points)
edited Feb 7 by thomas.behr
Thanks Thomas.  As an amendment to the original question, what is the impact of groups?  For example.... Node6/7/12 are in Group1 and Node4 has an edge to Group1.  If I select Node6, it would only select the group by nothing outside of it.

Similar to the approach for selecting subgraph edges, try running "Select Elements" multiple times. If you have "Clear Selection First" on tab "General" not marked, you will be able to incrementally increase the set of selected nodes with each run. Moreover, the selection criteria "Parents of Selected Nodes" and "Children of Selected Nodes" will allow you to select parent groups or child nodes.

E.g. for the amended example, the following approach should work:

  1. Run as explained above with "Clear Selection First" not marked.
  2. Run again with "Select" set to "Parents of Selected Nodes".
  3. Run again with "Select" set  to "Neighbors of Selected Nodes".

For more complex nesting structures, you will have to mix and match the criteria "Neighbors of Selected Nodes", "Parents of Selected Nodes", and "Children of Selected Nodes".