예제 #1
0
 public CommivoyageurTask Copy()
 {
     var c = new CommivoyageurTask (){ N = N, C = new int[N, N], X = new int[N, N] };
     for (int i = 0; i < N; i++)
         for (int j = 0; j < N; j++)
             c.C [i, j] = C [i, j];
     return c;
 }
예제 #2
0
        public CommivoyageurTask Copy()
        {
            var c = new CommivoyageurTask()
            {
                N = N, C = new int[N, N], X = new int[N, N]
            };

            for (int i = 0; i < N; i++)
            {
                for (int j = 0; j < N; j++)
                {
                    c.C [i, j] = C [i, j];
                }
            }
            return(c);
        }
예제 #3
0
파일: Program.cs 프로젝트: rettour/Labs
        public static void Main(string[] args)
        {
            int t = 0;
            CommivoyageurTask task = null;
            if (t == 0) {
                task = new CommivoyageurTask {
                    N = 5,
                    C = new int[,] {
                        { 2, 999, 3,4,5 },
                        {-5,8,-1,0,0},
                        {2,8,2,1,3},
                        {2,8,4,3,1},
                        {1,999,1,2,1}
                    }
                };
            }

            Console.WriteLine (task.ToLoopString (task.SolveByBranching ()));
        }