Issue with using Concorde in R
sarwanpasha opened this issue · 5 comments
I am trying to apply Concorde on the distance matrix. Here is my code
dataset is simply the text file containing edgelistof a graph
arr=dataset
nodelist = unique(as.vector(as.matrix(arr)))
arr_mat2 = matrix(0,length(nodelist),length(nodelist))
for (i in 1:length(arr[,1])){
arr_mat2[arr[i,1],arr[i,2]] = 1
}
arr_mat_new2 = arr_mat2
for(i in 1:length(arr_mat2[,1])){
arr_mat_new2[i,which(arr_mat2[i,]==0)] = 2
}
d2 <- as.dist(arr_mat_new2) # ASymmetric
atsp <- ATSP(d2) # ASymmetric
tsp<-reformulate_ATSP_as_TSP(atsp, cheap = 0)
o <- solve_TSP(tsp, method="concorde",rep=10, control = list(clo = "-V"))
I get the following output
Used control parameters:
clo = -V
exe = E:\Concorde_Code/concorde
precision = 6
verbose = TRUE
keep_files = FALSE
/Concorde_Code/concorde -x -V -o file1de811447e4a.sol file1de811447e4a.dat
Host: Pasha Current process id: 977
Using random seed 1586825616
FATAL ERROR - received signal SIGSEGV (11/11)
Problem Name: TSP
Generated by write_TSPLIB (R-package TSP)
Problem Type: TSP
Number of Nodes: 132
Explicit Lengths (CC_MATRIXNORM)
sleeping 1 more hours to permit debugger access
Can anyone tell me what am I doing wring here?
Hi, I just saw your question on StackOverflow.
I will answer there.
Hey, I have included the dataset and sessioninfo detail in the question on StackOverflow. Please check it.
Concorde likes similarities converted to dissimilarities using d = 1/(1+s) and has issues with the distances you create. The other heuristics in TSP can handle your distances.