#include "LKH.h"
#include "Heap.h"
/*
* The ReadProblem function reads the problem data in TSPLIB format from the
* file specified in the parameter file (PROBLEM_FILE).
*
* The following description of the file format is extracted from the TSPLIB
* documentation.
*
* The file consists of a specification part and a data part. The specification
* part contains information on the file format and on its contents. The data
* part contains explicit data.
*
* (1) The specification part
*
* All entries in this section are of the form <keyword> : <value>, where
* <keyword> denotes an alphanumerical keyword and <value> denotes
* alphanumerical or numerical data. The terms <string>, <integer> and <real>
* denote character string, integer or real data, respectively. The order of
* specification of the keywords in the data file is arbitrary (in principle),
* but must be consistent, i.e., whenever a keyword is specified, all
* necessary information for the correct interpretation of the keyword has to
* be known.
*
* Below is given a list of all available keywords.
*
* NAME : <string>e
* Identifies the data file.
*
* TYPE : <string>
* Specifies the type of data. Possible types are
* TSP Data for a symmetric traveling salesman problem
* ATSP Data for an asymmetric traveling salesman problem
* SOP Data for a sequence ordering problem
* HCP Hamiltonian cycle problem data
* HPP Hamiltonian path problem data (not available in TSPLIB)
* TSPTW Data for a TSP instance with time windows
* CCVRP Data for a cumulative capacitated vehicle routing problem
* CVRP Data for a symmetric capacitated vehicle routing problem
* ACVRP Data for an asymmetric capacitated vehicle routing problem
* CVRPTW Data for a capacitated vehicle routing problem with
* time windows
* VRPMPD Data for a mixed pickup and delivery problem with backhauls
* 1-PDTSP Data for a one-commodity pickup-and-delivery traveling
* salesman problem
* MLP Data for a minimum latency problem
* m-PDTSP Data for a mulity-commodity pickup-and-delivery traveling
* salesman problem
* m1-PDTSP Data for a mulity-commodity one-to-one pickup-and-delivery
* traveling salesman problem
* OVRP Data for an open vehicle routing problem
* PDTSP Data for a pickup and delivery traveling salesman problem
* PDTSPF Data for a pickup and delivery traveling salesman problem
* with FIFO loading
* PDTSPL Data for a pickup and delivery traveling salesman problem
* with LIFO loading
* PDPTW Data for a pickup and delivery problem with time windows
* RCTVRP Data for a risk-constrained cash-in-transit vehicle
* routing problem
* RCTVRPTW Data for a risk-constrained cash-in-transit vehicle
* routing problem with time windows
* TRP Data for a traveling repairman problem
* TSPDL Dara for a traveling salesman problem with draft limits
* TSPPD Data for a pickup and delivery travling salesman problem
* TSTSP Data for a Steiner traveling salesman problem
* VRPB Data for a vehicle routing problem with backhauls
* VRPBTW Data for a vehicle routing problem with backhauls and
* time windows
* CTSP Data for a colored traveling salesman problem
*
* COMMENT : <string>
* Additional comments (usually the name of the contributor or the creator of
* the problem instance is given here).
*
* DIMENSION : < integer>
* The number of nodes.
*
* CAPACITY : <integer>
* Specifies the truck capacity in a CVRP.
*
* DISTANCE : <real>
* The maximum length allowed for each route in a CVRP.
*
* EDGE_WEIGHT_TYPE : <string>
* Specifies how the edge weights (or distances) are given. The values are:
* ATT Special distance function for problem att48 and att532
* CEIL_2D Weights are Euclidean distances in 2-D rounded up
* CEIL_3D Weights are Euclidean distances in 3-D rounded up
* EUC_2D Weights are Euclidean distances in 2-D
* EUC_3D Weights are Euclidean distances in 3-D
* EXACT_2D Weights are EUC_2D distances (SCALE = 1000 as default)
* EXACT_3D Weights are EUC_3D distances (SCALE = 1000 as default)
* EXPLICIT Weights are listed explicitly in the corresponding section
* FLOOR_2D Weights are Euclidean distances in 2-D rounded down
* FLOOR_3D Weights are Euclidean distances in 3-D rounded down
* GEO Weights are geographical distances in kilometers (TSPLIB)
* Coordinates are given in the form DDD.MM where DDD are the
* degrees and MM the minutes
* GEOM Weights are geographical distances in meters (used for the
* world TSP). Coordinates are given in decimal form
* GEO_MEEUS Weights are geographical distances in kilometers, computed
* according to Meeus' formula. Coordinates are given in the
* form DDD.MM where DDD are the degrees and MM the minutes
* GEOM_MEEUS Weights are geographical distances, computed according to
* Meeus' formula. Coordinates are given in decimal form
* MAN_2D Weights are Manhattan distances in 2-D
* MAN_3D Weights are Manhattan distances in 3-D
* MAX_2D Weights are maximum distances in 2-D
* MAX_3D Weights are maximum distances in 3-D
* TOR_2D Wirghes are toroidal distances in 2-D
* TOR_3D Wirghes are toroidal distances in 3-D
* XRAY1 Distance function for crystallography problems (Version 1)
* XRAY2 Distance function for crystallography problems (Version 2)
* SPECIAL There is a special distance function implemented in
* the Distance_SPECIAL function.
*
* EDGE-WEIGHT_FORMAT : <string>
* Describes the format of the edge weights if they are given explicitly.
* The values are
* FUNCTION Weights are given by a function (see above)
* FULL_MATRIX Weights are given by a full matrix
* UPPER_ROW Upper triangular matrix
* (row-wise without diagonal entries)
* LOWER_ROW Lower triangular matrix
* (row-wise without diagonal entries)
* UPPER_DIAG_ROW Upper triangular matrix
* (row-wise including diagonal entries)
* LOWER_DIAG_ROW Lower triangular matrix
* (row-wise including diagonal entries)
* UPPER_COL Upper triangular matrix
* (column-wise without diagonal entries)
* LOWER_COL Lower triangular matrix
* (column-wise without diagonal entries)
* UPPER_DIAG_COL Upper triangular matrix
* (column-wise including diagonal entries)
* LOWER_DIAG_COL Lower triangular matrix
* (column-wise including diagonal entries)
*
* EDGE_DATA_FORMAT : <string>
* Describes the format in which the edges of a graph are given, if the
* graph is not complete. The values are
* EDGE_LIST The graph is given by an edge list
* ADJ_LIST The graph is given by an adjacency list
*
* NODE_COORD_TYPE : <string>
* Specifies whether the coordinates are associated with each node
* (which, for example may be used for either graphical display or
* distance computations.
* The values are
* TWOD_COORDS Nodes are specified by coordinates in 2-D
* THREED_COORDS Nodes are specified by coordinates in 3-D
* NO_COORDS The nodes do not have associated coordinates
* The default value is NO_COORDS. In the current implementation, however,
* the value has no significance.
*
* DISPLAY_DATA_TYPE : <string>
* Specifies how a graphical display of the nodes can be obt
没有合适的资源?快使用搜索试试~ 我知道了~
LKHWin-3.0.6_optimization_
共177个文件
c:158个
h:11个
par:2个
5星 · 超过95%的资源 3 下载量 172 浏览量
2021-09-29
18:40:27
上传
评论
收藏 279KB ZIP 举报
温馨提示
KLH-3 Optimization for TSP - Windows
资源推荐
资源详情
资源评论
收起资源包目录
LKHWin-3.0.6_optimization_ (177个子文件)
whizzkids96.atsp 56KB
ReadProblem.c 82KB
gpx.c 70KB
ReadParameters.c 52KB
Best5OptMove.c 40KB
BestSpecialOptMove.c 32KB
Create_POPMUSIC_CandidateSet.c 22KB
Delaunay.c 17KB
CreateQuadrantCandidateSet.c 17KB
Flip_SSL.c 17KB
Gain23.c 16KB
Best4OptMove.c 14KB
GreedyTour.c 14KB
SolveSubproblem.c 14KB
BridgeGain.c 12KB
PatchCycles.c 12KB
Flip_SL.c 11KB
SolveKMeansSubproblems.c 10KB
BIT.c 10KB
SolveSubproblemBorderProblems.c 9KB
BestKOptMove.c 9KB
MergeWithTourIPT.c 9KB
SolveRoheSubproblems.c 9KB
LKHmain.c 9KB
Make5OptMove.c 9KB
PrintParameters.c 8KB
Genetic.c 8KB
Ascent.c 8KB
SolveDelaunaySubproblems.c 8KB
OrderCandidateSet.c 8KB
Best3OptMove.c 8KB
Distance.c 8KB
ChooseInitialTour.c 7KB
CVRP_InitialTour.c 7KB
LinKernighan.c 6KB
CreateCandidateSet.c 6KB
C.c 6KB
FindTour.c 6KB
GenerateCandidates.c 5KB
MergeWithTourGPX2.c 5KB
PDTSPL_Tree.c 5KB
SFCTour.c 5KB
ERXT.c 4KB
SolveKarpSubproblems.c 4KB
MinimumSpanningTree.c 4KB
Sequence.c 4KB
Best2OptMove.c 4KB
SegmentSize.c 4KB
Statistics.c 4KB
MTSP_InitialTour.c 4KB
CreateDelaunayCandidateSet.c 4KB
SolveSFCSubproblems.c 4KB
BuildKDTree.c 4KB
Heap.c 4KB
SolveKCenterSubproblems.c 4KB
SolveTourSegmentSubproblems.c 4KB
Penalty_MTSP.c 3KB
WriteTour.c 3KB
MTSP2TSP.c 3KB
MakeKOptMove.c 3KB
STTSP2TSP.c 3KB
AllocateStructures.c 3KB
SOP_InitialTour.c 3KB
ReadCandidates.c 3KB
Flip.c 3KB
ReadEdges.c 3KB
Forbidden.c 3KB
Penalty_PDPTW.c 2KB
Penalty_MVRPB.c 2KB
Penalty_VRPPD.c 2KB
AdjustCandidateSet.c 2KB
SOP_RepairTour.c 2KB
Between_SSL.c 2KB
AddTourCandidates.c 2KB
Penalty_RCTVRP.c 2KB
Hashing.c 2KB
Connect.c 2KB
Penalty_CCVRP.c 2KB
CreateNNCandidateSet.c 2KB
TSPDL_InitialTour.c 2KB
Minimum1TreeCost.c 2KB
Penalty_VRPBTW.c 2KB
KSwapKick.c 2KB
PDTSPL_RepairTour.c 2KB
Penalty_SOP.c 2KB
FreeStructures.c 2KB
IsPossibleCandidate.c 2KB
Penalty_OVRP.c 2KB
AddExtraCandidates.c 2KB
Penalty_PDTSPF.c 2KB
AdjustClusters.c 2KB
Penalty_PDTSP.c 2KB
Penalty_CVRPTW.c 2KB
Random.c 2KB
Penalty_TRP.c 2KB
ReadPenalties.c 2KB
GeoConversion.c 2KB
MTSP_WriteSolution.c 2KB
WriteCandidates.c 2KB
TSPTW_Reduce.c 2KB
共 177 条
- 1
- 2
资源评论
- zzkq132022-06-07用户下载后在一定时间内未进行评价,系统默认好评。
余淏
- 粉丝: 51
- 资源: 3974
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功