Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Layouting cyclic graphs with DirectedGraphLayout
Layouting cyclic graphs with DirectedGraphLayout [message #234941] Fri, 01 June 2007 13:31 Go to next message
Eclipse UserFriend
Originally posted by: tupelo.arcor.de

This is a multi-part message in MIME format.
--------------050909010100070003010606
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

using DirectedGraphLayout for visualizing CFGs with cycles (iterations)
I encounter following problem:
as soon as a cycle occures the layout algorithm distorts the layout,
placing the end node higher than the other nodes though it should be
lower (see bad.gif). If I invert this looping edge the layout is great,
but the direction of this edge is wrong of course. Setting isFeedback on
this edge to true does deliver the wanted result (see good.gif) but this
access is deprecated.
So my question is, how to handle this problem? Is there a clean and
simple solution?
many thanks in advance,
tup

--------------050909010100070003010606
Content-Type: image/gif;
name="good.gif"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="good.gif"

R0lGODlhkQAaAfcAAAQCBISChMTCxPz+/Oa42AVy5AATEgAAAAAAcAIA5AAA EgAAADFA2QDk
ZwAS4AAAdwAOCACAYAAAWwAAAAAyAAAHAAAcAAAAAAD8AAD/AAD/BAD/AA8A 2AAA5AAAEgAA
AADBAQCHAABQAAAAAKAoAOKTABITAAAAAADRQwAPNwDhmwB3EmQBQ5kAAYgA AXcAAACwAABK
ABNiAAAAALAoAHKTABMTAAAAAAAy2AAH5AAcEgAAAHwywOIH5BIcEgAAAIgA 2AYA5BMAEgAA
ADDEU+PjYhIS4QAAd5G3AIEGAInhAHd3AKAAAJkAAIgAAHcAAP/A2P+H5P9Q Ev8AAECoAOMZ
ABI7AAAAAIKwgshKAoxiAHcAAJgQ8BoAYBMAYAAAALgNAHIA4BMA/QAAfzQD qAAALAAA4MAA
d9MDDscABYwAL3cAAAAAggEAAgAAAAAAAAEHAQEAAAEAAAEAADgOAOMAABIA AAAAAJG8yIEC
54kAEncAAFAAAJYAAIgAAHc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yr4C+
nFUXd8nL0wUTVhgkZkKYhUvRrU6ZhnPdMaVHOmhWU3bT9FXnrFmq7BWkmb+z XjG5STrAPY6c
iDRnNqF1L3CSc13rzBb6fuc+f9UNkPjiI2HmVskwfibMnw27ZxsF6kiC8gig EzPolRCKs3wu
cmEPjVhELzbRjZVHZwhSo7yEg1GtOfQ9h4nP1Ko40p0Rh2UlAqmIkgjFtKAU QuKBz40IRFPo
vLSlSkwpD096z5Q+7YlJ5OlHPVRS4nAnQvE5kUsVSiaGdsypIYNqyZhqNamu jKpewyrYtCo2
rpLNq2YDK9rEikKyxnCo+KxXJJeCThe2dY1vpWBc4TpXEdbVg3fFa14JuVe+ 9pWRf71mYKM5
WMIWViHx/FZiz+ergAAAOw==
--------------050909010100070003010606
Content-Type: image/gif;
name="bad.gif"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="bad.gif"

R0lGODlhNwHQAPcAAAQCBISChMTCxPz+/Oa42AVy5AATEgAAAAAAcAIA5AAA EgAAADFA2QDk
ZwAS4AAAdwAOCACAYAAAWwAAAAAuAAAHAAARAAAAAAD8AAD/AAD/BAD/AA8A 2AAA5AAAEgAA
AADBAQCHAABQAAAAAKAoAOKTABITAAAAAADRQwAPNwDhmwB3EmQBQ5kAAYgA AXcAAAD4AAAG
ABNjAAAAALAoAHKTABMTAAAAAAAu2AAH5AAREgAAAHwuwOIH5BIREgAAAIgA 2AYA5BMAEgAA
ADDEU+PjYhIS4QAAd5G3AIEGAInhAHd3AKAAAJkAAIgAAHcAAP/A2P+H5P9Q Ev8AAECoAOMZ
ABI7AAAAAIL4gsgGAoxjAHcAAJgQCBoAeRMAYgAAALgNAHIA4BMA/QAAfzQD qAAALAAA4MAA
d9MD0McABowAKHcAAAAAggEAAgAAAAAAAAEHAQEAAAEAAAEAADgOAOMAABIA AAAAAJG8yIEC
54kAEncAAFAAAJYAAIgAAHcAAP9gP/8ADP8AAf8A0AxgAOMAABIAAAAAAFgg B5r/AOiAAHcg
AAAAAAAA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m+Sy8Tk7f5GOUxU rnCPq/d2/4bP
5yyu4N2g7t8At83NR47TnZe85wLauM6DHnOgE8qx+KH5m4yup6MlHecy95ht oXvwnlPsXlSf
d9SvHqytCt3mXNdZiItOJanvy+s8L3vYnfVesm/V7Fhve9XVHrG4C/jnZYcZ zFKG069T5mR7
9xTa8T6j4J58RIZPOeKNe3icMV7xICcJy7U9+ZZUfteXh7fLM9zhmGQ+45vn MMwJj/GUfJ7U
p7d36Pm6+uV2ntypF3jk0Rx7k9Q+5K33roZbPnvG5B60vW/S76W6YhaPvPhw wbnyl8/85jv/
+dCPvvSnT/3qW//62M++9rfP/e57/yUBAQA7
--------------050909010100070003010606--
Re: Layouting cyclic graphs with DirectedGraphLayout [message #235124 is a reply to message #234941] Tue, 05 June 2007 23:28 Go to previous messageGo to next message
Anthony Hunter is currently offline Anthony HunterFriend
Messages: 446
Registered: July 2009
Senior Member
Hi,

If you are making use of org.eclipse.draw2d.graph.Node, check out
Node.setRowConstraint().

Cheers...
Anthony

"tupelo" <tupelo@arcor.de> wrote in message
news:f3p6nk$mg5$1@build.eclipse.org...
> Hi,
>
> using DirectedGraphLayout for visualizing CFGs with cycles (iterations)
> I encounter following problem:
> as soon as a cycle occures the layout algorithm distorts the layout,
> placing the end node higher than the other nodes though it should be
> lower (see bad.gif). If I invert this looping edge the layout is great,
> but the direction of this edge is wrong of course. Setting isFeedback on
> this edge to true does deliver the wanted result (see good.gif) but this
> access is deprecated.
> So my question is, how to handle this problem? Is there a clean and
> simple solution?
> many thanks in advance,
> tup
>
Re: Layouting cyclic graphs with DirectedGraphLayout [message #235172 is a reply to message #235124] Wed, 06 June 2007 11:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tupelo.arcor.de

Hi,

I'm using Node.setRowConstraint() in both examples and in both the left
to right order is as it should be, but my problem lies in the top->down
layout of nodes. So I'm not sure how the rowConstraint can fix this
problem since it only sets constraints on the left to right ordering of
the nodes, as far as I can see.

Thanks for answering,
regards,
tup


Anthony Hunter schrieb:
> Hi,
>
> If you are making use of org.eclipse.draw2d.graph.Node, check out
> Node.setRowConstraint().
>
> Cheers...
> Anthony
>
> "tupelo" <tupelo@arcor.de> wrote in message
> news:f3p6nk$mg5$1@build.eclipse.org...
>> Hi,
>>
>> using DirectedGraphLayout for visualizing CFGs with cycles (iterations)
>> I encounter following problem:
>> as soon as a cycle occures the layout algorithm distorts the layout,
>> placing the end node higher than the other nodes though it should be
>> lower (see bad.gif). If I invert this looping edge the layout is great,
>> but the direction of this edge is wrong of course. Setting isFeedback on
>> this edge to true does deliver the wanted result (see good.gif) but this
>> access is deprecated.
>> So my question is, how to handle this problem? Is there a clean and
>> simple solution?
>> many thanks in advance,
>> tup
>>
>
>
Re: Layouting cyclic graphs with DirectedGraphLayout [message #235443 is a reply to message #235172] Tue, 12 June 2007 14:58 Go to previous message
Eclipse UserFriend
Originally posted by: none.ibm.com

The algorithm is just using a greedy heuristic to find the "feedback arc
set". You must either remove the cycles before invoking the algorithm using
your own heuristic, or try to tune the algorithm using edge weights, which
will affect horizontal placement as well.

If you have time, you could try submitting a patch which allows the client
to provide the "break cycle" helper.

http://en.wikipedia.org/wiki/Feedback_arc_set
Heuristic used for compound graphs only:
http://www.google.com/patents?id=Co96AAAAEBAJ&printsec=d rawing&zoom=4&dq=inventor:+%22Thomas+Randall+Hudson% 22#PPP1,M1

"tupelo" <tupelo@arcor.de> wrote in message
news:f46468$tp1$1@build.eclipse.org...
> Hi,
>
> I'm using Node.setRowConstraint() in both examples and in both the left to
> right order is as it should be, but my problem lies in the top->down
> layout of nodes. So I'm not sure how the rowConstraint can fix this
> problem since it only sets constraints on the left to right ordering of
> the nodes, as far as I can see.
>
> Thanks for answering,
> regards,
> tup
>
>
> Anthony Hunter schrieb:
>> Hi,
>>
>> If you are making use of org.eclipse.draw2d.graph.Node, check out
>> Node.setRowConstraint().
>>
>> Cheers...
>> Anthony
>>
>> "tupelo" <tupelo@arcor.de> wrote in message
>> news:f3p6nk$mg5$1@build.eclipse.org...
>>> Hi,
>>>
>>> using DirectedGraphLayout for visualizing CFGs with cycles (iterations)
>>> I encounter following problem:
>>> as soon as a cycle occures the layout algorithm distorts the layout,
>>> placing the end node higher than the other nodes though it should be
>>> lower (see bad.gif). If I invert this looping edge the layout is great,
>>> but the direction of this edge is wrong of course. Setting isFeedback on
>>> this edge to true does deliver the wanted result (see good.gif) but this
>>> access is deprecated.
>>> So my question is, how to handle this problem? Is there a clean and
>>> simple solution?
>>> many thanks in advance,
>>> tup
>>>
>>
Previous Topic:notification of model from figure
Next Topic:How to use GEF in RCP.
Goto Forum:
  


Current Time: Thu Apr 25 04:58:22 GMT 2024

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

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

Back to the top