R/active_snw_search_sa.R
dot-simulated_annealing.RdThe candidate solution starts either with all positive-z-score nodes on
(when params$start_with_all_positives) or with each node switched on
independently with probability params$gene_init_prob. A random node is
toggled each step and the resulting subnetworks are compared rank-by-rank
against the current ones, accepting the change with a temperature-dependent
probability. The temperature decays geometrically from sa_initial_temp
to sa_final_temp over sa_iterations steps.
.simulated_annealing(network, sc, params, verbose = FALSE)A network from build_network() (provides the CSR
adjacency csr_offsets / csr_nbrs).
A score context from build_score_context().
A list of run parameters.
Logical; emit progress messages.
A list of subnetwork objects (all connected components of the final solution, sorted by score descending).
The search loop runs in C++ (run_simulated_annealing) and reproduces
the Java reference exactly: the same java.util.Random stream (seeded
with params$seed), the same initial-state draw order (node order), the
same nextInt-based node toggling, and the same acceptance walk over the
score-ranked subnetworks (advance to the next pair when a worse move passes
its Boltzmann draw; accept on a >0.001 improvement; otherwise reject).