benchmarkGeneratorQAP: Create Quadratic Assignment Problem (QAP) Benchmark

Description Usage Arguments Value See Also Examples

View source: R/permutationBenchmarkFunctions.R

Description

Creates a benchmark function for the Quadratic Assignment Problem.

Usage

1

Arguments

a

distance matrix

b

flow matrix

Value

the function of type cost=f(permutation)

See Also

benchmarkGeneratorFSP, benchmarkGeneratorTSP, benchmarkGeneratorWT

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
set.seed(1)
n=5
#ceate a flow matrix
A <- matrix(0,n,n) 
for(i in 1:n){
	for(j in i:n){
		if(i!=j){
			A[i,j] <- sample(100,1)
			A[j,i] <- A[i,j]
 	}
	}
}
#create a distance matrix
locations <- matrix(runif(n*2)*10,,2)
B <- as.matrix(dist(locations))
#create QAP objective function 
fun <- benchmarkGeneratorQAP(A,B)
#evaluate
fun(1:n)
fun(n:1)

CEGO documentation built on May 14, 2021, 1:08 a.m.