예제 #1
0
 /// <summary>
 /// Writes the given TSP problem to the given file.
 /// </summary>
 /// <param name="writer"></param>
 /// <param name="problem"></param>
 public static void Write(StreamWriter writer, TSPLIBProblem problem)
 {
     if (problem.Symmetric)
     {
         TSPLIBProblemWriter.GenerateTSP(writer, problem);
     }
     else
     {
         TSPLIBProblemWriter.GenerateATSP(writer, problem);
     }
 }
예제 #2
0
        /// <summary>
        /// Writes the given TSP problem to the given file.
        /// </summary>
        /// <param name="file"></param>
        /// <param name="problem"></param>
        public static void Write(FileInfo file, TSPLIBProblem problem)
        {
            StreamWriter writer = new StreamWriter(file.OpenWrite());

            TSPLIBProblemWriter.Write(writer, problem);
        }