Cycle Removal not working


I guess I am missing some implementation but the following code didn’t remove the cycles

<go:Diagram telerik:RadDragAndDropManager.AllowDrop=“True” Grid.Row=“0” x:Name=“myDiagram” Padding=“10” Model="{Binding Path=GoXamModel,Mode=TwoWay}"
HorizontalContentAlignment=“Stretch” VerticalContentAlignment=“Stretch”
NodeTemplate="{StaticResource NodeTemplate}" SelectedNode="{Binding SelectedNode,Mode=TwoWay}"
LinkTemplate="{StaticResource LinkTemplate}">
<golayout:LayeredDigraphLayout Direction=“90” SetsPortSpots=“True”

Is there anything else we need to implement ?


What do you mean by “didn’t remove the cycles”?
LayeredDigraphLayout is not supposed to change the graph relationships in your diagram, and definitely should not be changing your model by removing some links.

What do you mean by “didn’t remove the cycles”?

We need to run a calculation against each node the diagram if there will be cycles (links that result an infinite traversing of diagram) the system will get hanged. So, we need to make sure that there should be no link that leave the diagram in an infinite loop.

LayeredDigraphLayout is not supposed to change the graph relationships in your diagram

How can I accomplish the cycle removal in LayeredDigraph. We are free to choose another layout but the the goal is it should have N number of ports that should be linkable like we have in the LayeredDigraphLayout.

Thanks for your quick response

A well-designed app will not allow the user to create a situation that requires fixing. It sounds like you just need to set GraphLinksModel.ValidCycle, so that users cannot create cycles in their diagrams.


I can see that it is property of type string but didn't find it's valid value in the GoxamIntro_2.pdf document. Can you please provide me it's valid values. Thanks

Actually it is not of type string, but an enum.
For details, you should always use the API reference. In this case, ValidCycle property

I have set the valid cycle property on my goxam model

GoXamModel.ValidCycle = ValidCycle.DestinationTree;

This does remove the cycles but it didn’t allow me to draw more then 1 link from the same node even though it has more than one ports.

In the above diagram I was not able to link the 2nd port of 1st node to the 2nd port of the 2nd node (link with blue get disappeared when I release the mouse button).

Any though about it.


Yes, the usual definition of a tree structure means there aren’t multiple links coming into a node.

If you really want to make sure the graph is always a tree structure, are you sure you want to use LayeredDigraphLayout instead of TreeLayout? Or did you mean to use a different value for GraphLinksModel.ValidCycle?

Yes, I am open to use different value for