Description Usage Arguments Value Examples
Minimize a given graph metric (function) by iterative rewiring process. At each time step, a candidate is generated by rewiring
1 2 3 4 5 6 7 8 9 10 |
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 Infinite |
score.tolerance |
a numeric threshold of fun2min under which graph is accepted as result. Default is 0.01 (1% of a normalized metric) |
max.succ.reject |
maximal number of successive rejects of candidates, beyond which we consider that the graph cannot be improved anymore, and is returned. Default is 100 |
verbose |
Wether or not displaying fun2min evolution. Default is TRUE |
... |
additionnal arguments passed to rewiring.FUN |
a list of 5 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
1 2 3 4 5 | library(igraph)
g = sample_pa(n=100, power=1, m=1, directed=FALSE)
is_dag(g)
res = firstImprovement(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.