Learn R Programming

FLSSS (version 9.2.8)

arbFLSSSobjRun: Run an arbFLSSS instance

Description

Run an arbFLSSS instance decomposed from decomposeArbFLSSS().

Usage

arbFLSSSobjRun(
  X,
  solutionNeed = 1L,
  tlimit = 60,
  maxCore = 7L,
  ksumK = 0L,
  ksumTableSizeScaler = 30L,
  verbose = TRUE
  )

Value

Has the same return from arbFLSSS().

Arguments

X

An arbFLSSS object from decomposeArbFLSSS().

solutionNeed

See the same argument in arbFLSSS().

tlimit

See the same argument in arbFLSSS().

maxCore

See the same argument in arbFLSSS(). Mining subsets is single-threaded, but if X has no k-sum accelerator, users have the option of computing one on the fly, which is multithreaded. Will be ignored if X already has a k-sum accelerator.

ksumK

See the same argument in arbFLSSS(). Will be ignored if X already has a k-sum accelerator.

ksumTableSizeScaler

See the same argument in arbFLSSS(). Will be ignored if X already has a k-sum accelerator.

verbose

See the same argument in arbFLSSS(). Will be ignored if X already has a k-sum accelerator.

Details

The rationale follows mFLSSSobjRun(). The pair decomposeArbFLSSS() and arbFLSSSobjRun() makes up the distributed computing counterpart of arbFLSSS().

Examples

Run this code
set.seed(42)
d = 5L # Set dimension.
N = 30L # Set size.
len = 10L # Subset size.
roundN = 2L # For rounding the numeric values before conversion to strings.


V = matrix(round(runif(N * d, -1e5, 1e5), roundN), nrow = N) # Make superset.
sol = sample(N, len) # Make a solution.
target = round(colSums(V[sol, ]), roundN) # Target subset sum.


optionSave = options()
options(scipen = 999) # Ensure numeric => string conversion does not
# produce strings like 2e-3.
Vstr = matrix(as.character(V), nrow = N) # String version of V.
targetStr = as.character(target)


# system.time({
#   theDecomposed = FLSSS::decomposeArbFLSSS(
#     len = len, V = Vstr, target = targetStr, approxNinstance = 1000,
#     maxCore = 2, ksumTable = NULL, ksumK = 4, verbose = TRUE)
# })
# 
# 
# # Run the objects sequentially.
# rst = unlist(lapply(theDecomposed$arbFLSSSobjects, function(x)
# {
#   FLSSS::arbFLSSSobjRun(x, solutionNeed = 1e9, tlimit = 5, verbose = FALSE)
# }), recursive = FALSE)
# str(rst)
# 
# 
# options(optionSave)

Run the code above in your browser using DataLab