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.


yEd getting stuck on "Calculating Organic layout..."

+1 vote
The limit is set to 30 seconds. It's been stuck in this phase for over 10 minutes. "Stop" does nothing. Only "Abort" works. There are 4466 nodes with 36136 edges.  It used to work with similar graphs before, this behaviour is new. I thought it might have to do with upgrading to 3.19 so I rolled back to 3.18.2, but that didn't help. Is there anything I can do to fix this? Thanks. PS. Using Windows 10 standalone installation with the bundled JRE. Task manager shows constant activity (just 1 core by the looks of it).
in Help by

1 Answer

0 votes

The "Maximal Duration" for organic layout (and all other layout algorithms) is a "preferred maximal duration".  yEd's layout algorithms usually have a way of calculating low(er)-quality and high-quality arrangements. The algorithms have logic to switch from high-quality to low(er)-quality when approaching or exceeding the specified duration. However, for lots of elements, even calculating low-quality arrangements may exceed specified durations. Given the number of elements in your graph, it is very likely that calculating even a low-quality solution will exceed 30 seconds. Moreover, aside from the number of elements, the structure of the graph has a major impact on runtime as well. And since the number of edges in your graph is roughly eight times higher than the number of nodes, your graph's structure is probably not "good" either.

That said, I cannot rule out that you might have triggered a problem in the algorithm. However, to be sure I would actually need your graph (in GraphML format) for testing.

Finally, the only reliable fix is actually working with less elements. The main purpose of layout algorithms is arranging graphs in a way that is concise and clear to human beings. As a result, most layout algorithms are meant for small to mid-sized graphs, i.e. graphs with up to a few hundred elements only. Because not matter how good the layout of a graph, human beings cannot understand structures with 40000 elements. And while organic layout actually is the best-suited algorithm for larger structures, 40000 elements are still a lot.

by [yWorks] (160k points)
edited by
Here is the source file: https://mega.nz/#!bYdiSQBK!g1r8PierdPnbKlcMUXFyWaHmhrr8D8nPzLBww_rkvAA

It's in .tgf, which yEd can handle and what I'm using (it's much easier to generate tgf programmatically and then just import it into yEd).

While preparing this file I think I noticed the problem: my previous cases had 4k nodes and 4k edges.  This graph has 36k edges for some reason... so yeah, perhaps that's the problem.  However, "stop" still doesn't work, i.e. I can't even get a sub-optimal layout, even if I choose "speed" over "quality" in the settings.

Thank you very much for the sample file.

4K edges vs 36K edges makes a HUGE difference for runtime. Still arranging your graph with organic layout (default settings) takes around 25 seconds on my machine (i7 8x3.40GHz), which I think is fine given the number of elements in the graph. Due to the high edge count and the average node degree, the result is not too useful, though ... but see for yourself:
Resulting GraphML (compressed).

For completeness sake, I would like to clarify that even calculating the worst possible valid solution can take a long time if the graph is sufficiently large and dense. Moreover, "Stop" means "stop as soon as a valid solution has been found". Thus using "Stop" make sense if the algorithm is running for a long time but has not yet exceeded the specified (preferred) maximal duration. Once the specified (preferred) maximal duration is exceeded, the algorithm will stop as soon as possible anyways.

Hey, thank you for the help! I got surprised it finished so quickly for you, because I've never been able to get a solution (waited 20+ minutes). This got me thinking it has to do with the layout settings. I reset everything to default and yes, it worked. I'll be more careful with those sliders in the future. Cheers!
Legal Disclosure | Privacy Policy