Computes the connected subnetworks induced by the on-nodes and stores their scores (sorted descending) for fast fitness comparison. The scores are obtained with the C++ component scorer over the precomputed CSR adjacency, which is the only thing the fitness comparison (.ga_compare / .ga_sort_desc) ever reads. The node membership of a genome is not materialized here — it is reconstructed once, for the best individual, at the end of .genetic_algorithm().

.ga_make_individual(rep_logical, csr_offsets, csr_nbrs, z_vec, means, stds)

Arguments

rep_logical

A logical vector aligned to network$nodes (TRUE = node on). May be empty.

csr_offsets, csr_nbrs

CSR adjacency from build_network().

z_vec

Per-node z-scores aligned to the node order.

means, stds

Score-context calibration vectors.

Value

A list with elements rep (the genome) and scores (the descending component scores).