/// <summary>
        /// Find the lines, if any, that make up the maximum independent set
        /// of intersecting diagonals for determining where to slice our
        /// initial polygon.
        /// </summary>
        private static Dictionary <Line, int> GetSliceMap(Dictionary <Line, List <Line> > intersectionGraph)
        {
            Dictionary <Line, int> sliceMap = new Dictionary <Line, int>();
            int index = 1;

            foreach (
                var pair in intersectionGraph
                .Where(pair => pair.Value.Count != 0)
                .Where(pair => !sliceMap.ContainsKey(pair.Key))
                )
            {
                sliceMap[pair.Key] = index++;
            }

            var vc = new VertexCover(sliceMap.Count);

            foreach (var pair in intersectionGraph)
            {
                if (pair.Value.Count <= 0)
                {
                    continue;
                }
                foreach (Line line in pair.Value)
                {
                    int u = sliceMap[pair.Key];
                    int v = sliceMap[line];
                    vc.Add(u, v);
                }
            }

            var vcData = vc.FindCover(sliceMap.Count);

            if (vcData.Count <= 0)
            {
                return(sliceMap);
            }

            int smallest = vcData.Min(s => s.Size);
            var set      = vcData.FirstOrDefault(v => v.Size == smallest);

            if (set == null)
            {
                return(sliceMap);
            }

            for (int i = 0; i < set.Size; i++)
            {
                var pair = sliceMap.FirstOrDefault(n => n.Value == set[i]);
                sliceMap.Remove(pair.Key);
            }
            return(sliceMap);
        }
        /// <summary>
        /// Find the lines, if any, that make up the maximum independent set
        /// of intersecting diagonals for determining where to slice our
        /// initial polygon.
        /// </summary>
        private static Dictionary<Line, int> GetSliceMap(Dictionary<Line, List<Line>> intersectionGraph)
        {
            Dictionary<Line, int> sliceMap = new Dictionary<Line, int>();
            int index = 1;
            foreach (
                var pair in intersectionGraph
                    .Where(pair => pair.Value.Count != 0)
                    .Where(pair => !sliceMap.ContainsKey(pair.Key))
                )
            {
                sliceMap[ pair.Key ] = index++;
            }

            var vc = new VertexCover(sliceMap.Count);
            foreach (var pair in intersectionGraph)
            {
                if (pair.Value.Count <= 0)
                {
                    continue;
                }
                foreach (Line line in pair.Value)
                {
                    int u = sliceMap[ pair.Key ];
                    int v = sliceMap[ line ];
                    vc.Add(u, v);
                }
            }

            var vcData = vc.FindCover(sliceMap.Count);
            if (vcData.Count <= 0)
            {
                return sliceMap;
            }

            int smallest = vcData.Min(s => s.Size);
            var set = vcData.FirstOrDefault(v => v.Size == smallest);
            if (set == null)
            {
                return sliceMap;
            }

            for (int i = 0; i < set.Size; i++)
            {
                var pair = sliceMap.FirstOrDefault(n => n.Value == set[ i ]);
                sliceMap.Remove(pair.Key);
            }
            return sliceMap;
        }