//public void OutputResults(ResultCollection res)
        //{
        //    int count = 0;
        //    foreach (Results r in res.ResultSet)
        //    {
        //        Console.WriteLine("Result set {0}", ++count);
        //        Console.WriteLine("Permutuations: {0}", r.Permutations);
        //        foreach (Line l in r.Lines)
        //        {
        //            Console.Write("Line: ");
        //            foreach (MyPoint p in l.Points)
        //            {
        //                Console.Write("({0}, {1}) ", p.X, p.Y);
        //            }
        //            Console.WriteLine();
        //        }
        //        Console.WriteLine();
        //    }
        //    Console.Read();
        //}
        public void OutputResults2(MyList<MyPoint> set1, ResultCollection2 res)
        {
            int count = 0;
            for (int k = 0; k < res.ResultSet.Count; k++)
            {
                Results2 r = res.ResultSet[k];
                Console.WriteLine("Result set {0}", ++count);
                Console.WriteLine("Permutuations: {0}", r.Permutations);
                int c = r.Count;
                for (int j = 0; j < c; j++)
                {
                    ItemSet l = r.GetLine(j);
                    if (r.Count == 1)
                    {
                        Console.WriteLine("Emergency");
                    }
                    Console.Write("Line: ");

                    for (int i = 0; i < l.Count; i++)
                    {
                        Console.Write("({0}, {1}) ", l.GetItem(set1, i).X, l.GetItem(set1, i).Y);
                    }

                    Console.WriteLine();
                }
                Console.WriteLine();
            }
            Console.Read();
        }
        public ResultCollection2 GetBestSet(int lineCount)
        {
            ResultCollection2 ret = new ResultCollection2();

            int nRes = this.ResultSet.Count;
            for (int i = 0; i < nRes; i++)
            {
                if (this.ResultSet[i].Count == lineCount)
                {
                    ret.ResultSet.Add(this.ResultSet[i]);
                }
            }

            return ret;
        }