Description Usage Arguments Value Examples
Try to minimize a given graph metric (function) through rewiring process. Metaheuristic trying to find a global optimum rather than local optimum.
1 2 3 4 5 6 7 8 9 10 11 |
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 |
a list of 7 elements:
the optimized graph
the fun2min value obtained at the end of the process
list of igraphs object. History of successive improvements
number of iterations elapsed
Acceptation rate during the process
initial temperature passed as argument
cooling method passed as argument
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.