diff --git a/src/GraphShape/Algorithms/Layout/Simple/Hierarchical/EfficientSugiyamaAlgorithm.DoCrossingMinimizations.cs b/src/GraphShape/Algorithms/Layout/Simple/Hierarchical/EfficientSugiyamaAlgorithm.DoCrossingMinimizations.cs index b4ac68b..615e907 100644 --- a/src/GraphShape/Algorithms/Layout/Simple/Hierarchical/EfficientSugiyamaAlgorithm.DoCrossingMinimizations.cs +++ b/src/GraphShape/Algorithms/Layout/Simple/Hierarchical/EfficientSugiyamaAlgorithm.DoCrossingMinimizations.cs @@ -29,6 +29,9 @@ public partial class EfficientSugiyamaLayoutAlgorithm /// private void DoCrossingMinimizations() { + if (_layers.Count < 2) + return; + int prevCrossings = int.MaxValue; int crossings = int.MaxValue; int phase = 1;