simulatedAnnealing: Graph Rewiring Simulated Annealing Improvement Optimization...

Description Usage Arguments Value Examples

View source: R/optimization.R

Description

Try to minimize a given graph metric (function) through rewiring process. Metaheuristic trying to find a global optimum rather than local optimum.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
simulatedAnnealing(
  g,
  rewiring.FUN = NULL,
  fun2min = NULL,
  niter = Inf,
  temp0 = 1,
  cooling.method = c("exp", "fast", "boltz"),
  cooling.factor = 0.99,
  verbose = TRUE,
  ...
)

Arguments

g

an igraph object.

rewiring.FUN

function of rewiring to apply to the graph at each time step.

fun2min

function, metric to minimize.

niter

maximal number of iterations. Default is Inf.

temp0

initial temperature. Default is 1.

cooling.method

method used to progressively decrease temperature. Defaut is "exp".

cooling.factor

decimal between 0 and 1, used if cooling.method="exp". Lower cooling factor make temperature (and candidate acceptation probability) decreasing faster. Default is 0.95.

verbose

Wether or not displaying fun2min evolution. Default is FALSE.

...

additionnal arguments passed to rewiring.FUN

Value

a list of 7 elements:

g

the optimized graph

value

the fun2min value obtained at the end of the process

g_list

list of igraphs object. History of successive improvements

iter

number of iterations elapsed

acceptation_rate

Acceptation rate during the process

temp0

initial temperature passed as argument

cooling.method

cooling method passed as argument

Examples

1
2
3
4
5
library(igraph)
g = sample_pa(n=100, power=1, m=1,  directed=FALSE)
is_dag(g)
res = simulatedAnnealing(g, rewiring.FUN=rewire, with=each_edge(prob=1),
 fun2min=transitivity, niter=10)

MiloMonnier/supplynet documentation built on Feb. 16, 2021, 8:03 p.m.