Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

filterTSPInstances

Filter TSPlib instances according to its specifications.


Description

Given a directory of TSP problems in the TSPlib format with file extension .tsp, this function reads the specifications of each TSPlib instance in that directory and returns a data frame with rowwise information about each instance.

Basically the function is a wrapper around getTSPInstancesOverview.

Usage

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

Arguments

directory

[character(1)]
Readable directory path.

expr

[expression]
Expression wrapped with the quote function.

paths.only

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

opt.known

[logical(1)]
Filter instances x with unknown optimal tour length (given in file x.tsp.tour)? Default is FALSE.

Value

[data.frame]

See Also

Examples

## Not run: 
# Get a data frame of instances and its properties for all instances
# with more than 4000 nodes
filterTSPInstances("path/to/instances", quote(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 = quote(edge_weight_type %in% c("EUC_2D", "CEIL_2D")),
  paths.only = TRUE
)

## End(Not run)

netgen

Network Generator for Combinatorial Graph Problems

v1.3.2
BSD_3_clause + file LICENSE
Authors
Jakob Bossek [aut, cre]
Initial release
2020-01-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.