コード例 #1
0
        public TestClass()
        {
            var t1 = Task.Factory.StartNew(() =>
            {
                var gen       = new GraphGenerator();
                SmallInstance = gen.GenerateRandomGraph(200, 0.3);
            });
            var t2 = Task.Factory.StartNew(() =>
            {
                var gen        = new GraphGenerator();
                MediumInstance = gen.GenerateRandomGraph(2000, 0.3);
            });
            var t3 = Task.Factory.StartNew(() =>
            {
                var gen     = new GraphGenerator();
                BigInstance = gen.GenerateRandomGraph(4000, 0.3);
            });

            Task.WaitAll(t1, t2, t3);
        }