LayerArrays YLayeringAndOrdering(LayerCalculator layering) {
            #region reporting

#if REPORTING
            Timer t = null;
            if (sugiyamaSettings.Reporting) {
                t = new Timer();
                Report("ylayering ... ");
                t.Start();
            }
#endif

            #endregion

            int[] yLayers = layering.GetLayers();
            Balancing.Balance(GluedDagSkeletonForLayering, yLayers, GetNodeCountsOfGluedDag(), null);
            yLayers = ExtendLayeringToUngluedSameLayerVertices(yLayers);

            #region reporting

#if REPORTING
            if (sugiyamaSettings.Reporting) {
                t.Stop();
                Report(String.Format(CultureInfo.CurrentCulture, "{0}\n", t.Duration));
                Report("ordering ... ");
                t.Start();
            }
#endif

            #endregion

            var layerArrays = new LayerArrays(yLayers);
            //if (!SugiyamaSettings.UseEdgeBundling && (HorizontalConstraints == null || HorizontalConstraints.IsEmpty)) {
            if (HorizontalConstraints == null || HorizontalConstraints.IsEmpty) {
                layerArrays = YLayeringAndOrderingWithoutHorizontalConstraints(layerArrays);

                #region reporting

#if REPORTING
                if (sugiyamaSettings.Reporting) {
                    t.Stop();
                    Report(String.Format(CultureInfo.CurrentCulture, "{0}\n", t.Duration));
                }
#endif

                #endregion

                return layerArrays;
            }
            constrainedOrdering = new ConstrainedOrdering(originalGraph, IntGraph, layerArrays.Y, nodeIdToIndex,
                                                          database, sugiyamaSettings);
            constrainedOrdering.Calculate();
            properLayeredGraph = constrainedOrdering.ProperLayeredGraph;

            #region reporting

#if REPORTING
            if (sugiyamaSettings.Reporting) {
                t.Stop();
                Report(String.Format(CultureInfo.CurrentCulture, "{0}\n", t.Duration));
            }
#endif

            #endregion

            // SugiyamaLayoutSettings.ShowDatabase(this.database);
            return constrainedOrdering.LayerArrays;
        }
        LayerArrays YLayeringAndOrdering(LayerCalculator layering) {

            int[] yLayers = layering.GetLayers();
            yLayers = ExtendLayeringToUngluedSameLayerVertices(yLayers);
            var layerArrays = new LayerArrays(yLayers);
            //if (!SugiyamaSettings.UseEdgeBundling && (HorizontalConstraints == null || HorizontalConstraints.IsEmpty)) {
            if (HorizontalConstraints == null || HorizontalConstraints.IsEmpty) {
                layerArrays = YLayeringAndOrderingWithoutHorizontalConstraints(layerArrays);
                return layerArrays;
            }
            constrainedOrdering = new ConstrainedOrdering(originalGraph, IntGraph, layerArrays.Y, nodeIdToIndex,
                                                          database, sugiyamaSettings);
            constrainedOrdering.Calculate();
            properLayeredGraph = constrainedOrdering.ProperLayeredGraph;


            // SugiyamaLayoutSettings.ShowDatabase(this.database);
            return constrainedOrdering.LayerArrays;
        }