Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Eclipse Layout Kernel » GreedyCycleBreaker algorithm in ELK layered
GreedyCycleBreaker algorithm in ELK layered [message #1738393] Tue, 19 July 2016 12:24 Go to next message
Gerd  Wütherich is currently offline Gerd WütherichFriend
Messages: 12
Registered: July 2009
Junior Member
Hi,

currently I'm implementing a diagram viewer component using KLighd and elk/layered (release 0.1.0) to visualize dependencies between software artifacts (see attached image). While KLay Layered produces awesome result, I have some questions regarding the GreedyCycleBreaker algorithm used in phase 1 (CycleBreaking):

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.

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?

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...

Any thoughts and/or comments are highly appreciated!

Thanks in advance,
Gerd
Re: GreedyCycleBreaker algorithm in ELK layered [message #1738398 is a reply to message #1738393] Tue, 19 July 2016 12:55 Go to previous messageGo to next message
Christoph Daniel Schulze is currently offline Christoph Daniel SchulzeFriend
Messages: 68
Registered: September 2015
Member
Hi Gerd,

glad you're happy with our algorithm. Let's dive right into answering your questions. Wink

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. Smile

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.
Re: GreedyCycleBreaker algorithm in ELK layered [message #1738403 is a reply to message #1738398] Tue, 19 July 2016 13:14 Go to previous message
Gerd  Wütherich is currently offline Gerd WütherichFriend
Messages: 12
Registered: July 2009
Junior Member
Hi Christoph,

I think the InteractiveCycleBreaker approach is the way to go for me. And 'happy with our algorithm' is understated Wink

Thanks for your fast reply and your fantastic work!
Previous Topic:Orthogonal Bus Routing in ELK Layered - how?
Next Topic:Does ELK work on Mac?
Goto Forum:
  


Current Time: Sun Aug 19 19:06:52 GMT 2018

Powered by FUDForum. Page generated in 0.02654 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top