vertex overlapping issue

Jul 16, 2010 at 6:52 AM
Edited Jul 16, 2010 at 6:54 AM

To achieve layout of vertexes from left to right. I am writing following code.

[SAMPLE CODE]

try
{
layout.OverlapRemovalConstraint = AlgorithmConstraints.Must;
}
catch (Exception ex)
{ 
}
try
{
layout.EdgeRoutingConstraint = AlgorithmConstraints.Must;
}
catch (Exception ex)
{ 
}
GraphSharp.Algorithms.OverlapRemoval.OverlapRemovalParameters overlapRemoval = new GraphSharp.Algorithms.OverlapRemoval.OverlapRemovalParameters();
overlapRemoval.HorizontalGap = 100; 
overlapRemoval.VerticalGap = 0;
layout.OverlapRemovalParameters = overlapRemoval; 

BOTH STATEMENTS IN TRY CATCH BLOCKS GENERATES FOLLOWING EXCEPTION SO AS A WORK AROUND I WROTE THEM IN TRY CATCH 

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at System.Collections.Generic.List`1.get_Item(Int32 index)
at GraphSharp.Controls.GraphLayout`3.ChangeState(Int32 stateIndex)
at GraphSharp.Controls.GraphLayout`3.RecalculateOverlapRemoval()
at GraphSharp.Controls.GraphLayout`3.OverlapRemovalConstraint_PropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at GraphSharp.Controls.GraphLayout`3.set_OverlapRemovalConstraint(AlgorithmConstraints value)



AS OUTPUT I GET ALL VERTEXES FROM LEFT TO RIGHT BUT VERTEXES ARE OVERLAPPING WHICH IS MAKING READABILITY ALMOST IMPOSSIBLE. JUST WONDERING IF THERE IS ANY SOLUTION FOR THIS.

tHANKS