Learn R Programming

netgen (version 1.3)

filterTSPInstances: Filter TSPlib instances according to its specifications.

Description

Given a directory, this function reads the specifications of each TSPlib instance in that directory and returns a subset.

Usage

filterTSPInstances(directory = NULL, expr, paths.only = FALSE)

Arguments

directory

[character(1)] Readable directory path.

expr

[expression] Expression wrapped with the . function.

paths.only

[logical(1)] Should only the full file names of the instances be returned? Default is FALSE.

Value

[data.frame]

See Also

getTSPInstancesOverview

Examples

Run this code
# NOT RUN {
# Get a data frame of instances and its properties for all instances
# with more than 4000 nodes
filterTSPInstances("path/to/instances", dimension > 4000)

# Now get only the full file names of all instances with edge weight type
# EUC_2D or CEIL_2D (see tsplib documentation for details)
filterTSPInstances("path/to/instances",
  expr = edge_weight_type %in% c("EUC_2D", "CEIL_2D"),
  paths.only = TRUE
)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab