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.

Categories

In automatic layout, child nodes create edges to themselves

0 votes

Hello, this software is great and perfectly meets my needs. But I encountered the same problem(https://yed.yworks.com/support/qa/8523/does-automatic-layout-create-edges-that-point-their-source) as him in use.

When I use the One-click Layout or other layouts, the child nodes at the end seem to automatically generate edges connected to them. According to the previous instructions, I am pretty sure that I have not done these operations and checked the Neighborhood View. There is no problem. This troubles me a lot.

This software is really attractive to me. If there is a problem with my settings or my operation, please let me know, thank you very much!

https://yed.yworks.com/support/qa/?qa=blob&qa_blobid=132646281634995447

https://yed.yworks.com/support/qa/?qa=blob&qa_blobid=14447305805360986820

The extra edges are also automatically marked in yellow and become selected. It can be deleted at this time.

However, the redundant edges in the previous example are not selected and cannot be deleted directly.

in Help by

2 Answers

0 votes
 
Best answer

Thank you very much for including sample files with your question.

The "extra edges" as you call them are actually not generated by One-Click layout (or any other layout algorithm) but exist in your sample files already. You can check this for yourself:

  1. Ensure no elements are selected. (If there are selected elements, simply click on empty space to  unselect all.)
  2. Take a look at the properties view in yEd's lower right corner. This will list the total number of nodes and edges in the current diagram.
    E.g. for your self-loop-del.graphml sample, it says:
  3. Count the actually visible edges in your diagram.
    E.g. for your self-loop-del.graphml sample, there are only five visible edges.

(In your self-loop.graphml sample, there are 24 visible edges out of 52 edges in total.)

Since all the non-visible edges are self-loops, I think you simply created those by accident. You probably started edge creation, moved the mouse out of your start node, then back into your start node, and released the mouse button in the start node. Unfortunately, your default edge style seems to be "Arc" which simply is not suited for self-loops which is why you do not see them by default.

To get rid of all the undesired edges, select all self-loops and press DELETE to remove all the non-visible but nevertheless selected edges.
To select all self-loops:

  1. Open "Tools" -> "Select Elements".
  2. On tab "General", select "Clear Selection First" and only ""Clear Selection First".
  3. On tab "Edges", select "Use these Criteria" and choose "All Selfloops" for option "Select".
  4. On all other tabs, ensure that "Use these Criteria" is not selected.
  5. Click "Ok".

Finally, the fact that self-loops are sometimes selected after running One-Click layout is actually a bug (layout algorithms should never modify the current selection) and will be fixed in a future release. Thank you very much for bringing this to our attention.

by [yWorks] (160k points)
Thank you very much for your prompt help. I followed the instructions you gave, and it really reproduced the situation. Sure enough, I made a mistake. Fortunately, your detailed explanation let me know how to avoid it in the future. And you gave a solution, which allowed me to solve the problem and learn more about the software's functions. Your serious attitude deserves my admiration!
0 votes
The undesired selection changed has been fixed in yEd 3.21.
by [yWorks] (160k points)
Legal Disclosure | Privacy Policy
...