Try using the built-in Link class, not your subclass, in your link template.
The standard LayeredDigraphLayout routing will separate those overlapping link path segments.
Yes, I know that there will be no overlay with standard links.
But isn’t there a solution to have the connected nodes be opposite? As in the first picture
This link route is a must for me
The TreeLayout does not suit me because any node can have many parents. This is just an example. I already have a ready-made project in which a lot has been done specifically for LayeredDigraphLayout