Exports a network to the TSPlib format.

exportToTSPlibFormat(x, filename, name = NULL, comment = NULL,
  use.extended.format = TRUE, full.matrix = FALSE, digits = 10L)

Arguments

x

[Network]
Network to export.

filename

[character(1)]
File name.

name

[character(1) | NULL]
Character string describing the instance. Used for the NAME field in the TSPlib file format. Otherwise, the name of the instance is used. If the latter is NULL, this parameter is mandatory.

comment

[character(1) | NULL]
Optional string with additional information about the instance. Used for the COMMENT field. If not provided the comment field of the instance is used. If the latter is NULL, no comment at all is saved.

use.extended.format

[logical(1)]
Use the “extended tsplib format” with additional information like cluster membership and bounds? Default is TRUE.

full.matrix

[logical(1)]
Make use of “FULL\_MATRIX” “EDGE\_WEIGHT\_FORMAT” instead of node coordinates? Default is FALSE.

digits

[integer(1)]
Round coordinates to this number of digits. Default is 10.

Value

Nothing

Note

Currently we only support euclidean 2D instances. Furthermore note, that if use.extended.format is TRUE, most alternative TSPlib parsers will most probably not be able to parse the generated file.