Free cookie consent management tool by TermsFeed Policy Generator

source: branches/GeneralizedQAP/HeuristicLab.Problems.Instances/3.3/Instances/ITSPInstance.cs @ 7466

Last change on this file since 7466 was 7466, checked in by abeham, 13 years ago

#1614

  • included TSLIB's ATSP and CVRP problems as well
File size: 3.0 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22
23namespace HeuristicLab.Problems.Instances {
24  public enum TSPDistanceMeasure { Direct, Euclidean, RoundedEuclidean, UpperEuclidean, Geo, Manhattan, Maximum, Att };
25
26  /// <summary>
27  /// Describes instances of the Traveling Salesman Problem (TSP).
28  /// </summary>
29  public interface ITSPInstance {
30    /// <summary>
31    /// The name of the instance
32    /// </summary>
33    string Name { get; }
34    /// <summary>
35    /// Optional! The description of the instance
36    /// </summary>
37    string Description { get; }
38
39    /// <summary>
40    /// The number of cities.
41    /// </summary>
42    int Dimension { get; }
43    /// <summary>
44    /// Specifies the distance measure that is to be used.
45    /// </summary>
46    TSPDistanceMeasure DistanceMeasure { get; }
47    /// <summary>
48    /// Optional! The distances are given in form of a distance matrix.
49    /// </summary>
50    /// <remarks>
51    /// Either this property or <see cref="Coordinates"/> needs to be specified.
52    /// </remarks>
53    double[,] Distances { get; }
54    /// <summary>
55    /// Optional! A a matrix of dimension [N, 2] matrix where each row is one of the cities
56    /// and the colmns represent x and y coordinates respectively.
57    /// </summary>
58    /// <remarks>
59    /// Either this property or <see cref="Distances"/> needs to be specified.
60    ///
61    /// If no distance matrix is given, the distances have to be calculated by the
62    /// specified distance measure. If a distance matrix is given in addtion to the
63    /// coordinates, the distance matrix takes precedence and the coordinates are
64    /// for display only.
65    /// </remarks>
66    double[,] Coordinates { get; }
67
68    /// <summary>
69    /// Optional! The best-known tour in path-encoding.
70    /// </summary>
71    int[] BestKnownTour { get; }
72    /// <summary>
73    /// Optional! The quality of the best-known tour.
74    /// </summary>
75    double? BestKnownQuality { get; }
76
77    /// <summary>
78    /// If only the coordinates are given, can calculate the distance matrix.
79    /// </summary>
80    /// <returns>A full distance matrix between all cities.</returns>
81    double[,] GetDistanceMatrix();
82  }
83}
Note: See TracBrowser for help on using the repository browser.