/// <summary>
        /// Removes the overlaps for the given graph.
        /// </summary>
        public void RemoveOverlaps()
        {
            if (_nodes.Length < 3)
            {
                RemoveOverlapsOnTinyGraph();
                return;
            }

            Point[] nodePositions;
            Size[]  nodeSizes;
            ProximityOverlapRemoval.InitNodePositionsAndBoxes(_settings, _nodes
                                                              , out nodePositions, out nodeSizes);
            if (_overlapForLayers)
            {
                nodeSizes = _sizes;
            }

            lastRunNumberIterations = 0;
            while (OneIteration(nodePositions, nodeSizes, false))
            {
                lastRunNumberIterations++;
            }
            while (OneIteration(nodePositions, nodeSizes, true))
            {
                lastRunNumberIterations++;
            }


            for (int i = 0; i < _nodes.Length; i++)
            {
                _nodes[i].Center = nodePositions[i];
            }
        }
        /// <summary>
        /// Removes the overlaps for the given graph.
        /// </summary>
        public void RemoveOverlaps()
        {
            if (_nodes.Length < 3)
            {
                RemoveOverlapsOnTinyGraph();
                return;
            }

            Point[] nodePositions;
            Size[]  nodeSizes;
            ProximityOverlapRemoval.InitNodePositionsAndBoxes(_settings, _nodes
                                                              , out nodePositions, out nodeSizes);
            if (_overlapForLayers)
            {
                nodeSizes = _sizes;
            }
            if (_settings.InitialScaling != InitialScaling.None)
            {
                DoInitialScaling(_nodes, nodePositions, nodeSizes, InitialScaling.Inch72Pixel);
            }

            lastRunNumberIterations = 0;
            while (OneIteration(nodePositions, nodeSizes, false))
            {
                lastRunNumberIterations++;
//                if (lastRunNumberIterations%10 == 0)
//                    Console.Write("removing overlaps with cdt only {0},", lastRunNumberIterations);
            }
            //        Console.WriteLine();
            while (OneIteration(nodePositions, nodeSizes, true))
            {
                lastRunNumberIterations++;
//                Console.Write("iterations with sweeping line {0},", lastRunNumberIterations);
            }

            Console.WriteLine();

            for (int i = 0; i < _nodes.Length; i++)
            {
                _nodes[i].Center = nodePositions[i];
            }
        }
        /// <summary>
        /// Removes the overlap for the given graph.
        /// </summary>
        /// <param name="graph"></param>
        public void RemoveOverlap(GeometryGraph graph)
        {
            if (graph.Nodes.Count < 3)
            {
                RemoveOverlapsOnTinyGraph(graph);
                return;
            }

            Point[] nodePositions;
            Size[]  nodeSizes;
            ProximityOverlapRemoval.InitNodePositionsAndBoxes(Settings,
                                                              graph, out nodePositions,
                                                              out nodeSizes);
            if (Settings.InitialScaling != InitialScaling.None)
            {
                DoInitialScaling(graph, nodePositions, nodeSizes, InitialScaling.Inch72Pixel);
            }

            lastRunNumberIterations = 0;
            while (OneIteration(nodePositions, nodeSizes, false))
            {
                lastRunNumberIterations++;
//                if (lastRunNumberIterations%10 == 0)
//                    Console.Write("removing overlaps with cdt only {0},", lastRunNumberIterations);
            }
            //        Console.WriteLine();
            while (OneIteration(nodePositions, nodeSizes, true))
            {
                lastRunNumberIterations++;
//                Console.Write("iterations with sweeping line {0},", lastRunNumberIterations);
            }

            Console.WriteLine();

            for (int i = 0; i < graph.Nodes.Count; i++)
            {
                graph.Nodes[i].Center = nodePositions[i];
            }
        }