API Reference

The public API exposes four groups of functions: the core workflow, system-function builders, the reference-state search helpers used internally by run_ref_extraction_by_mcs(), and the active-acquisition rule that chooses which unknown sample it resolves next.

Core workflow

rsr.rsr.run_ref_extraction_by_mcs

Extract boundary reference states via Monte Carlo search.

rsr.rsr.get_comp_cond_sys_prob

P(system state | given component states).

rsr.rsr.get_comp_cond_sys_prob_multi

Estimate P(system state = s | given component states) for multi-state systems by Monte Carlo.

System-function builders

rsr.igraph_sfun.make_igraph_sfun_global_conn

Create an igraph-accelerated sfun for global connectivity.

rsr.igraph_sfun.make_igraph_sfun_conn

Create an igraph-accelerated sfun for 1OD connectivity.

rsr.igraph_sfun.eval_global_conn_igraph

igraph-accelerated version of eval_global_conn_k.

rsr.igraph_sfun.eval_1od_connectivity_igraph

igraph-accelerated version of eval_1od_connectivity.

rsr.igraph_sfun.nx_to_igraph

Convert a NetworkX graph to igraph, preserving node names and edge IDs.

Active acquisition

Deciding which unknown sample to resolve next, used by run_ref_extraction_by_mcs() when active_ref_search is enabled.

rsr.rsr.select_refs_by_acquisition

Pick the unresolved candidates with the highest acquisition score.

rsr.rsr.compute_deficits

Smallest componentwise violation of each candidate against a reference set.

rsr.rsr.acquisition_score

Acquisition score (d+ + d-) - gamma * |d+ - d-|.

rsr.rsr.refs_mat_to_states

Convert a binary reference tensor to integer component-state coordinates.

rsr.rsr.validate_ref_consistency

Raise if any lower reference state dominates an upper reference state.