带协和式飞机的R-TSP包

带协和式飞机的R-TSP包,r,windows,R,Windows,我已经安装了TSP包并开始工作。 我从协和式飞机(TSP/滑铁卢)网站下载了所有文件。我试过不同的版本。甚至提取了所有的文件 我把文件放在我的R工作目录中。 最后,当运行concorde_path()时,它能够检测到找到的文件。 但是,当我运行concorde_help()时,我收到一个错误 我得到一个cygwin1.dll未找到错误。所以我安装了cygwin。 我仍然得到一个错误。 我尝试将所有协和文件放在cygwin(cygwin1.dll所在的位置)的bin文件夹中,并将R工作目录和协和路

我已经安装了TSP包并开始工作。 我从协和式飞机(TSP/滑铁卢)网站下载了所有文件。我试过不同的版本。甚至提取了所有的文件

我把文件放在我的R工作目录中。 最后,当运行concorde_path()时,它能够检测到找到的文件。 但是,当我运行concorde_help()时,我收到一个错误

我得到一个cygwin1.dll未找到错误。所以我安装了cygwin。 我仍然得到一个错误。 我尝试将所有协和文件放在cygwin(cygwin1.dll所在的位置)的bin文件夹中,并将R工作目录和协和路径()指向那里,结果出现了状态123错误

我还下载了协和式windows应用程序,它确实有效。我发现另一个帖子建议它必须工作才能在R内工作

在Windows下运行R/Rstudio


感谢您提供的任何建议和帮助。

我刚刚为TSPMap工作,希望它能帮助其他人

Concorde for windows似乎没有可用于TSP包的命令行界面。。这就是Cygwin的用武之地,因为该版本的concorde可以在命令行上工作,并与TSP包接口

你真的需要先让它在cygwin工作。。所以您需要启动cygwin控制台并运行它

如果你的控制台工作正常,你可以下载协和式二进制文件并进行测试。。只要在cygwin中运行./concorde.exe,就会显示程序的帮助

另一个测试是使用下面的测试文件,看看这在协和飞机上是否有效

NAME: TEST
TYPE: TSP
DIMENSION: 6
EDGE_WEIGHT_TYPE: EXPLICIT
EDGE_WEIGHT_FORMAT: FULL_MATRIX
EDGE_WEIGHT_SECTION:
0 1 2 1 1 2
1 0 1 2 2 1
2 1 0 1 2 1
1 2 1 0 1 2
1 2 2 1 0 1
2 1 1 2 1 0
一旦在cygwin中实现了这一点,就应该从命令行尝试一下cygwin是否与windows集成。如果这是好的,R不应该有问题

如果您的系统能够识别,此命令应显示协和式命令行帮助


t1我遵循上面“斯蒂芬·戴维森”给出的答案。但是,我仍然得到cygwin1.dll文件丢失错误。我在C驱动器中安装了cygwin 32位。我所做的是从C:\cygwin\bin文件夹中获取cygwin1.dll文件,并将其粘贴到我的R工作目录中,即E:\RA\Concorde\u代码

然后在我的R-studio(安装了64位)中,我运行以下代码来检查协和式飞机是否工作

concordePath = "E:/RA/Concorde_Code/"
concorde_path(concordePath)
上面写着

found: concorde concorde.exe
然后我运行了以下代码

concorde_help()
tour_test <- solve_TSP(tsp_test, method = "concorde")
它给了我以下输出

The following options can be specified in solve_TSP with method "concorde" using clo in control:

/Concorde_Code/concorde
Usage: /Concorde_Code/concorde [-see below-] [dat_file]
   -B    do not branch
   -C #  maximum chunk size in localcuts (default 16)
   -d    use dfs branching instead of bfs
   -D f  edgegen file for initial edge set
   -e f  initial edge file
   -E f  full edge file (must contain initial edge set)
   -f    write optimal tour as edge file (default is tour file)
   -F f  read extra cuts from file
   -g h  be a grunt for boss h
   -h    be a boss for the branching
   -i    just solve the blossom polytope
   -I    just solve the subtour polytope
   -J #  number of tentative branches
   -k #  number of nodes for random problem
   -K h  use cut server h
   -M f  master file
   -m    use multiple passes of cutting loop
   -n s  problem location (just a name or host:name, not a file name)
   -o f  output file name (for optimal tour)
   -P f  cutpool file
   -q    do not cut the root lp
   -r #  use #x# grid for random points, no dups if #<0
   -R f  restart file
   -s #  random seed
   -S f  problem file
   -t f  tour file (in node node node format)
   -u v  initial upperbound
   -U    do not permit branching on subtour inequalities
   -v    verbose (turn on lots of messages)
   -V    just run fast cuts
   -w    just subtours and trivial blossoms
   -x    delete files on completion (sav pul mas)
   -X f  write the last root fractional solution to f
   -y    use simple cutting and branching in DFS
   -z #  dump the #-lowest reduced cost edges to file xxx.rcn
   -N #  norm (must specify if dat file is not a TSPLIB file)
         0=MAX, 1=L1, 2=L2, 3=3D, 4=USER, 5=ATT, 6=GEO, 7=MATRIX,
         8=DSJRAND, 9=CRYSTAL, 10=SPARSE, 11-15=RH-norm 1-5, 16=TOROIDAL
         17=GEOM, 18=JOHNSON
Used control parameters:
clo  =  
exe  =  E:\RA\Concorde_Code\/concorde
precision    =  6
verbose  =  TRUE
keep_files   =  FALSE
/Concorde_Code/concorde -x -o file225841777aa0.sol file225841777aa0.dat
Host: Pasha  Current process id: 1193
Using random seed 1586547969
Problem Name: TSP
Generated by write_TSPLIB (R-package TSP)
Problem Type: TSP
Number of Nodes: 6
Explicit Lengths (CC_MATRIXNORM)
Optimal Solution: 60000.00
Total Running Time: 0.01 (seconds)

我想反驳,这是一个非常具体的问题。我还说明了我在连接协和式飞机功能时遇到的问题。它是一个外部函数,不在CRAN上托管,但TSP包确实连接到它。我已经编辑了这个问题,删除了“逐步教程”部分。