|
Re: GreedyCycleBreaker algorithm in ELK layered [message #1738398 is a reply to message #1738393] |
Tue, 19 July 2016 12:55   |
Christoph Daniel Schulze Messages: 98 Registered: September 2015 |
Member |
|
|
Hi Gerd,
glad you're happy with our algorithm. Let's dive right into answering your questions. 
Gerd Wütherich wrote on Tue, 19 July 2016 12:24
1) Is there a way to access the (reversed) feedback edges from within the klihgd systhesis? Or more generally: Is it possible to access the reversed from 'outside'? In my scenario the feedback edges are interpreted as 'forbidden' or 'unwanted' dependencies in a layered architecture, so it would be nice to be able to color them in the underlying KGraph, to list them explicitly in a list viewer etc.
The layout algorithm doesn't set a property on reversed edges. Still, you can always tell if an edge was reversed by looking at the coordinates of its end points. The coordinate are not available to the synthesis, though, since automatic layout happens after the synthesis has completed. You probably want to look at the IStyleModifier interface, which can modify the KRendering style of graph elements based on the layout result. If you have further questions on this, our Confluence Questions would be the place to ask them. 
Gerd Wütherich wrote on Tue, 19 July 2016 12:24
2) The GreedyCycleBreaker randomly removes/reverses edges if there are multiple possibilities. In my scenario, this leads to 'unwanted' removals/reversals, as my underlying graph contains weighted edges. Is there a way to influence the algorithm so that edges with a lighter weight are removed prior to edges with a heavier weight?
There is, in fact. You can set the LayeredOptions.PRIORITY option on an edge to a value >1. The higher the priority, the higher the chance that it won't be reversed. That's no guarantee, however.
Gerd Wütherich wrote on Tue, 19 July 2016 12:24
3) Is it possible to specify the edges to reverse from the outside (e.g. in the Klighd synthesis?) In this case one could completely bypass the built-in cycle breaker algorithm and compute and specify the minimal feedback set from within the KGraph specification...
There is. You can switch to the InteractiveCycleBreaker to do so. In your case, the interactive cycle breaker will use the y coordinate of your nodes to determine edges to be reverse. If in your synthesis you place node A above node B, an edge from B to A will be reversed. You can simply generate fake coordinates that ensure that the correct set of edges will be reversed.
|
|
|
|
Powered by
FUDForum. Page generated in 0.01521 seconds