Ejemplo n.º 1
0
        /// <summary>
        /// Converts a problem.
        /// </summary>
        /// <param name="atsp"></param>
        /// <param name="name"></param>
        /// <param name="comment"></param>
        /// <returns></returns>
        public static TSPLIBProblem Convert(IProblem atsp, string name, string comment)
        {
            // convert the problem to a symetric one.
            IProblem symetric = atsp.ConvertToSymmetric();

            return new TSPLIBProblem(name, comment, symetric.Size, symetric.WeightMatrix,
                TSPLIBProblemWeightTypeEnum.Explicit, TSPLIBProblemTypeEnum.TSP, 0, 0);
        }