Boolean Network

Created on Wed Aug 13 11:08:44 2025

@author: Benjamin Coberly, Claus Kadelka

boolforge.boolean_network.get_entropy_of_basin_size_distribution(basin_sizes: list | array) float[source]

Compute the Shannon entropy of the basin size distribution.

This function calculates the Shannon entropy of a probability distribution derived from the basin sizes. First, the basin sizes are normalized to form a probability distribution, and then the entropy is computed using the formula: H = - sum(p_i * log(p_i)), where p_i is the proportion of the basin size i.

Parameters:

  • basin_sizes (list | np.array): A list where each element represents the size of a basin, i.e., the number of initial conditions that converge to a particular attractor.

Returns:

  • float: The Shannon entropy of the basin size distribution.

class boolforge.boolean_network.WiringDiagram(I: list | ndarray, variables: list | array | None = None, weights=None)[source]

Bases: object

A class representing a Wiring Diagram

Constructor Parameters:

  • I (list[list[int]] | np.ndarray[list[int]]): A list of N lists representing the regulators (or inputs) for each Boolean function.

  • variables (list[str] | np.array[str], optional): A list of N strings representing the names of each variable, default = None.

  • weights (list[list[int | np.nan]]): #TODO

Members:

  • I (list[np.array[int]]): As passed by the constructor.

  • variables (np.array[str]): As passed by the constructor.

  • N_variables (int): The number of variables in the Boolean network.

  • N_constants (int): The number of constants in the Boolean network.

  • N (int): The number of variables and constants in the Boolean network.

  • indegrees (list[int]): The indegrees for each node.

  • outdegrees (list[int]): The outdegrees of each node.

  • weights (list[list[int | np.nan]]): As passed by the constructor.

classmethod from_DiGraph(nx_DiGraph: DiGraph) WiringDiagram[source]

Compatibility Method:

Converts a networkx.DiGraph instance into a WiringDiagram object. Each node in the DiGraph represents a Boolean variable, and each directed edge (u → v) indicates that variable u regulates variable v.

Parameters:

  • nx_DiGraph (nx.DiGraph): A directed graph where edges represent regulatory influences (u → v).

  • Node attributes (optional):

    • ‘name’: a string name of the variable (defaults to node label).

    • ‘weight’: numerical edge weights (stored in weights matrix, optional).

Returns:

  • WiringDiagram: An instance constructed from the graph structure.

Example:

>>> import networkx as nx
>>> G = nx.DiGraph()
>>> G.add_edges_from([(0, 1), (1, 2), (2, 0)])
>>> WD = WiringDiagram.from_DiGraph(G)
>>> WD.I
[array([2]), array([0]), array([1])]
>>> WD.variables
array(['x0', 'x1', 'x2'], dtype='<U2')
get_outdegrees() array[source]

Returns the outdegree of each node.

Returns:

  • np.array[int]: Outdegree of each node.

get_constants(AS_DICT: bool = True) dict | array[source]

Identify constants in a Boolean network.

A node is considered a constant if it has no regulators.

Parameters:

  • AS_DICT (bool, optional): Whether to return the indices of constants as a dictionary or array. If true, returns as a dictionary. Defaults to True.

Returns:

If AS_DICT is True:

  • dict[int:bool]: Dictionary determining if an index is a constant or not.

else:
  • np.array[int]: Array of node indices that are constants.

get_strongly_connected_components() list[source]

Determine the strongly connected components of a wiring diagram.

Returns:

  • list[set[int]]: A list of sets, each representing a strongly connected component.

get_modular_structure()[source]

Determine the modular structure of a Boolean network.

The modular structure is defined by a directed acyclic graph (DAG) whose nodes are the strongly connected components (SCCs) of the underlying wiring diagram and whose directed edges indicate a regulation from one SCC to another SCC.

Returns:

  • set[tuple[int]]: A set of edges, describing a directed acyclic graph indicating the regulations between modules (i.e., strongly connected components of the underlying wiring diagram).

get_ffls() tuple | list[source]

Identify feed-forward loops (FFLs) in a Boolean network based solely on the wiring diagram.

The function uses the inverted wiring diagram to identify common targets and returns the FFLs found. If types_I (the type of each regulation) is provided, it also returns the corresponding regulation types.

Parameters:

  • types_I (list[list[str]], optional): List of lists specifying the type (e.g., ‘increasing’ or ‘decreasing’) for each regulation.

Returns:

If self.weights is not None:

  • tuple[list[int], list[int]]: (ffls, types) where ffls is a list of identified FFLs (each as a list [master regulator, intermediate, target]), and types is a list of regulation type triplets (master -> target, master -> intermediate, intermediate -> target).

Otherwise:

  • list[list[int]]: A list of identified FFLs.

generate_networkx_graph() DiGraph[source]

Generate a NetworkX directed graph from a wiring diagram.

Nodes are labeled with variable names (from variables) and constant names (from constants). Edges are added from each regulator to its target based on the wiring diagram I.

Parameters:

  • constants (list[str]): List of constant names.

  • variables (list[str]): List of variable names.

Returns:

  • networkx.DiGraph: The wiring diagram as directed graph.

generate_networkx_graph_from_edges(n_variables: int) DiGraph[source]

Generate a NetworkX directed graph from an edge list derived from the wiring diagram.

Only edges among the first n_variables (excluding constant self-loops) are included.

Parameters:

  • n_variables (int): Number of variable nodes (constants are excluded).

Returns:

  • networkx.DiGraph: The generated directed graph.

get_type_of_loop(loop: list) list[source]

Determine the regulation types along a feedback loop.

For a given loop (a list of node indices), this function returns a list containing the type (e.g., ‘increasing’ or ‘decreasing’) of each regulation along the loop. The loop is assumed to be ordered such that the first node is repeated at the end.

Parameters:

  • loop (list[int]): List of node indices representing the loop.

Returns:

  • list[int]: A list of regulation types corresponding to each edge in the loop.

__weakref__

list of weak references to the object

class boolforge.boolean_network.BooleanNetwork(F: list | ndarray, I: list | ndarray | WiringDiagram, variables: list | array | None = None, SIMPLIFY_FUNCTIONS: bool | None = False)[source]

Bases: WiringDiagram

A class representing a Boolean network with N variables.

Constructor Parameters:

  • F (list[BooleanFunction | list[int]] | np.ndarray[BooleanFunction | list[int]]): A list of N Boolean functions, or of N lists of length 2^n representing the outputs of a Boolean function with n inputs.

  • I (list[list[int]] | np.ndarray[list[int]] | WiringDiagram): A list of N lists representing the regulators (or inputs) for each Boolean function.

  • variables (list[str] | np.array[str], optional): A list of N strings representing the names of each variable, default = None.

  • SIMPLIFY_FUNCTIONS (bool, optional): Constructs this Boolean Network to only include its essential components. Defaults to False

Members:

  • F (list[BooleanFunction]): As passed by the constructor.

  • I (list[np.array[int]]): As passed by the constructor.

  • variables (np.array[str]): As passed by the constructor.

  • N (int): The number of variables in the Boolean network.

  • N_constants (int): The number of constants in the Boolean network.

  • size (int): The number of variables and constants in the Boolean network.

  • indegrees (list[int]): The indegrees for each node.

  • outdegrees (list[int]): The outdegrees of each node.

  • STG (dict): The state transition graph.

  • weights (np.array[float] | None): Inherited from WiringDiagram. Default None.

remove_constants(values_constants: list | None = None) None[source]

Removes constants from this Boolean network.

Parameters:

  • values_constants (list, optional): The values to fix for each constant node in the network. If None, takes the value provided by the constant function.

classmethod from_cana(cana_BooleanNetwork: cana.boolean_network.BooleanNetwork) BooleanNetwork[source]

Compatability Method:

Converts an instance of cana.boolean_network.BooleanNetwork from the cana module into a Boolforge BooleanNetwork object.

Returns:

  • A BooleanNetwork object.

classmethod from_string(network_string: str, separator: str | list | array = ',', max_degree: int = 24, original_not: str | list | array = 'NOT', original_and: str | list | array = 'AND', original_or: str | list | array = 'OR') BooleanNetwork[source]

Compatability Method:

Converts a string into a Boolforge BooleanNetwork object.

Returns:

  • A BooleanNetwork object.

to_cana() cana.boolean_network.BooleanNetwork[source]

Compatability method:

Returns an instance of the class cana.BooleanNetwork from the cana module.

Returns:

  • An instance of cana.boolean_network.BooleanNetwork

to_bnet(separator=',\t', AS_POLYNOMIAL: bool = True) str[source]

Compatability method:

Returns a bnet string formatted as a polynomial.

Parameters:

  • separator (str): A string used to separate the target variable from the function. Defaults to ‘, ‘.

  • AS_POLYNOMIAL (bool, optional): Determines whether to return the function as a polynomial or logical expression. If true, returns as a polynomial, and if false, returns as a logical expression. Defaults to true.

Returns:

  • str: A string describing a bnet.

to_truth_table(RETURN: bool = True, filename: str = None) DataFrame[source]

Determines the full truth table of the Boolean network as pandas DataFrame.

Each row shows the input combination (x1, x2, …, xN) and the corresponding output(s) f(x).

The output is returned as a pandas DataFrame and can optionally be exported to a file in CSV or Excel format.

Parameters:

  • RETURN (bool, optional): Whether to return the truth table as a pandas DataFrame. Defaults to True.

  • filename (str, optional): If provided, the truth table is written to a file. The file extension determines the format and must be one of: ‘csv’, ‘xls’, or ‘xlsx’. Example: “truth_table.csv” or “truth_table.xlsx”. If None (default), no file is created.

Returns:

  • pd.DataFrame: The full truth table with shape (2^N, 2N). Returned only if RETURN=True.

Notes:

  • The function automatically computes the synchronous state transition graph (STG) if it has not been computed yet.

  • Each output row represents a deterministic transition from the current state to its next state under synchronous updating.

  • Exporting to Excel requires the openpyxl package to be installed.

__str__()[source]

Return str(self).

__call__(state)[source]

Perform a synchronous update of a Boolean network.

Each node’s new state is determined by applying its Boolean function to the current states of its regulators.

Parameters:

  • X (list[int] | np.array[int]): Current state vector of the network.

Returns:

  • np.array[int]: New state vector after the update.

get_types_of_regulation() array[source]

Computes the weights of this Boolean network and assigns them to the weights member variable.

Returns:

  • weights (np.array): The weights of this network.

simplify_functions() None[source]

Remove all non-essential inputs, i.e., inoperative edges from the Boolean network.

For each node in a Boolean network, represented by its Boolean function and its regulators, this function extracts the “essential” part of the function by removing non-essential regulators. The resulting network contains, for each node, a reduced truth table (with only the essential inputs) and a corresponding list of essential regulators.

Returns:

  • BooleanNetwork: A Boolean network object where:

    • F is a list of N Boolean functions containing functions of length 2^(m_i), with m_i ≤ n_i, representing the functions restricted to the essential regulators.

    • I is a list of N lists containing the indices of the essential regulators for each node.

get_source_nodes(AS_DICT: bool = False) dict | array[source]

Identify source nodes in a Boolean network.

A node is considered a source node if it does not change over time. It has exactly one regulator and that regulator is the node itself.

Parameters:

  • AS_DICT (bool, optional): Whether to return the indices of source nodes as a dictionary or array. If true, returns as a dictionary. Defaults to False.

Returns:

If AS_DICT is True:

  • dict[int:bool]: Dictionary determining if an index is a source nodes or not.

else:
  • np.array[int]: Array of all indices of source nodes.

get_network_with_fixed_source_nodes(values_source_nodes: list | array) BooleanNetwork[source]

Fix the values of source nodes within this Boolean Network.

Parameters:

  • values_source_nodes (list | np.array): The values to fix for each source node within this network. Must be of length equivalent to the number of source nodes in the network, and each element must be either 0 or 1.

Returns:

  • BooleanNetwork: A BooleanNetwork object with fixed source nodes.

get_network_with_node_controls(indices_controlled_nodes: list | array, values_controlled_nodes: list | array, KEEP_CONTROLLED_NODES: bool = False) BooleanNetwork[source]

Fix the values of nodes within this BooleanNetwork.

Parameters:

  • indices_controlled_nodes (list | np.array): The indices of the nodes to fix the value of.

  • values_controlled_nodes : (list | np.array): The values to fix for each specified node in the network.

  • KEEP_CONTROLLED_NODES : (bool, optional): Whether to turn controlled nodes into constants or not. If true, controlled nodes become constants and will be baked into the network. If false, they will not be considered as constants. Defaults to false.

Returns:

  • BooleanNetwork: A BooleanNetwork object with specified nodes controlled.

get_network_with_edge_controls(control_targets: int | list | array, control_sources: int | list | array, type_of_edge_controls: int | list | array | None = None) BooleanNetwork[source]

Generate a perturbed Boolean network by removing the influence of specified regulators on specified targets.

The function modifies the Boolean function for target nodes by restricting it to those entries in its truth table where the input from given regulators equals the specified type_of_control. The regulators are then removed from the wiring diagram for that node.

Parameters:

  • control_targets (int | list[int] | np.array[int]): Index of the target node(s) to be perturbed.

  • control_sources (int | list[int] | np.array[int]): Index of the regulator(s) whose influence is to be fixed.

  • type_of_edge_controls (int | list[int] | np.array[int]) | None): Source value in regulation of target after control. Default is None (which is interpreted as 0).

Returns:

  • BooleanNetwork object where:

    • F is the updated list of Boolean functions after perturbation.

    • I is the updated wiring diagram after removing the control regulator from the target node.

update_single_node(index: int, states_regulators: list | array) int[source]

Update the state of a single node.

The new state is obtained by applying the Boolean function f to the states of its regulators. The regulator states are converted to a decimal index using utils.bin2dec.

Parameters:

  • index (int): The index of the Boolean Function in F.

  • states_regulators (list[int] | np.array[int]): Binary vector representing the states of the node’s regulators.

Returns:

  • int: Updated state of the node (0 or 1).

update_network_synchronously(X: list | array) array[source]

Perform a synchronous update of a Boolean network.

Each node’s new state is determined by applying its Boolean function to the current states of its regulators.

Parameters:

  • X (list[int] | np.array[int]): Current state vector of the network.

Returns:

  • np.array[int]: New state vector after the update.

update_network_synchronously_many_times(X: list | array, n_steps: int) array[source]

Update the state of a Boolean network sychronously multiple time steps.

Starting from the initial state, the network is updated synchronously n_steps times using the update_network_synchronously function.

Parameters:

  • X (list[int] | np.array[int]): Initial state vector of the network.

  • n_steps (int): Number of update iterations to perform.

Returns:

  • np.array[int]: Final state vector after n_steps updates.

update_network_SDDS(X: list | array, P: array, *, rng=None) array[source]

Perform a stochastic update (SDDS) on a Boolean network.

For each node, the next state is computed as nextstep = F[i] evaluated on the current states of its regulators. If nextstep > X[i], the node is activated with probability P[i,0]; if nextstep < X[i], the node is degraded with probability P[i,1]. Otherwise, the state remains unchanged.

Parameters:

  • X (list[int] | np.array[int]): Current state vector.

  • P (np.array[float]): A len(F)×2 array of probabilities; for each node i, P[i,0] is the activation probability, and P[i,1] is the degradation probability.

  • rng (None, optional): Argument for the random number generator, implemented in ‘utils._coerce_rng’.

Returns:

  • np.array[int]: Updated state vector after applying the stochastic update.

get_steady_states_asynchronous(nsim: int = 500, EXACT: bool = False, initial_sample_points: list = [], search_depth: int = 50, DEBUG: bool = False, *, rng=None) dict[source]

Compute the steady states of a Boolean network under asynchronous updates.

This function simulates asynchronous updates of a Boolean network (with N nodes) for a given number of initial conditions (nsim). For each initial state, the network is updated asynchronously until a steady state (or attractor) is reached or until a maximum search depth is exceeded. The simulation can be performed either approximately (by sampling nsim random initial conditions) or exactly (by iterating over the entire state space when EXACT == True).

Parameters:

  • nsim (int, optional): Number of initial conditions to simulate (default is 500).

  • EXACT (bool, optional): If True, iterate over the entire state space and guarantee finding all steady states (2^N initial conditions); otherwise, use nsim random initial conditions. (Default is False.)

  • initial_sample_points (list[list[int]], optional): List of initial states (as binary vectors) to use. If provided and EXACT is False, these override random sampling.

  • search_depth (int, optional): Maximum number of asynchronous update iterations to attempt per simulation.

  • DEBUG (bool, optional): If True, print debugging information during simulation.

  • rng (None, optional): Argument for the random number generator, implemented in ‘utils._coerce_rng’.

Returns:

  • dict[str:Variant]: A dictionary containing:

    • SteadyStates (list[int]): List of steady state values (in decimal form) found.

    • NumberOfSteadyStates (int): Total number of unique steady states.

    • BasinSizes (list[int]): List of counts showing how many initial conditions converged to each steady state.

    • STGAsynchronous (dict[tuple(int, int):int]): The asynchronous state transition graph. STGAsynchronous[(a,i)] = c implies that state a transitions to state c when the ith variable is updated. Here, a and c are decimal representations of the state and i is in {0, 1, …, self.N-1}.

    • InitialSamplePoints (list[int]): The list of initial sample points used (if provided) or those generated during simulation.

get_steady_states_asynchronous_given_one_initial_condition(initial_condition: int | list | array = 0, nsim: int = 500, stochastic_weights: list = [], search_depth: int = 50, DEBUG: bool = False, *, rng=None) dict[source]

Determine the steady states reachable from one initial condition using weighted asynchronous updates.

This function is similar to steady_states_asynchronous_given_one_IC but allows the update order to be influenced by provided stochastic weights (one per node). A weight vector (of length N) may be provided, and if given, it is normalized and used to bias the random permutation of node update order.

Parameters:

  • initial_condition (int | list[int] | np.array[int], optional): The initial state for all simulations. If an integer, it is converted to a binary vector. Default is 0.

  • nsim (int, optional): Number of simulation runs (default is 500).

  • stochastic_weights (list[float], optional): List of stochastic weights (one per node) used to bias update order. If empty, uniform random order is used.

  • search_depth (int, optional): Maximum number of asynchronous update iterations per simulation (default is 50).

  • DEBUG (bool, optional): If True, print debugging information (default is False).

  • rng (None, optional): Argument for the random number generator, implemented in ‘utils._coerce_rng’.

Returns:

  • dict[str:Variant]: A dictionary containing:

    • SteadyStates (list[int]): List of steady state values (in decimal form) reached.

    • NumberOfSteadyStates (int): Total number of unique steady states.

    • BasinSizes (list[int]): List of counts of how many simulations reached each steady state.

    • TransientTimes (list[list[int]]): List of lists with transient times (number of updates) for each steady state.

    • STGAsynchronous (dict[tuple(int, int):int]): A sample of the asynchronous state transition graph. STGAsynchronous[(a,i)] = c implies that state a transitions to state c when the ith variable is updated. Here, a and c are decimal representations of the state and i is in {0, 1, …, self.N-1}.

    • UpdateQueues (list[list[int]]): List of state update queues (the sequence of states encountered) for each simulation.

get_attractors_synchronous(nsim: int = 500, initial_sample_points: list = [], n_steps_timeout: int = 1000, INITIAL_SAMPLE_POINTS_AS_BINARY_VECTORS: bool = False, *, rng=None) dict[source]

Compute the number of attractors in a Boolean network.

This version is optimized for networks with longer average path lengths. For each of nb initial conditions, the network is updated synchronously until an attractor is reached or until n_steps_timeout is exceeded. The function returns the attractors found, their basin sizes, a mapping of states to attractors, the set of initial sample points used, the explored state space, and the number of simulations that timed out.

Hybrid Numba-accelerated version: - Python logic for bookkeeping (dicts, cycles, basins) - Compiled numeric kernel for Boolean updates

Parameters:

  • nsim (int, optional): Number of initial conditions to simulate (default is 500). Ignored if ‘initial_sample_points’ are provided.

  • initial_sample_points (list[int | list[int]], optional): List of initial states to use. ‘INITIAL_SAMPLE_POINTS_AS_BINARY_VECTORS’ specifies whether these points are given as vectors or decimals.

  • n_steps_timeout (int, optional): Maximum number of update steps allowed per simulation (default 1000).

  • INITIAL_SAMPLE_POINTS_AS_BINARY_VECTORS (bool, optional): If True, initial_sample_points are provided as binary vectors; if False, they are given as decimal numbers. Default is False.

  • rng (None, optional): Argument for the random number generator, implemented in ‘utils._coerce_rng’.

Returns:

  • dict[str:Variant]: A dictionary containing:

    • Attractors (list[list[int]]): List of attractors (each as a list of states in the attractor cycle).

    • NumberOfAttractors (int): Total number of unique attractors found. This is a lower bound.

    • BasinSizes (list[int]): List of counts for each attractor. This is an unbiased estimator.

    • AttractorDict (dict[int:int]): Dictionary mapping states (in decimal) to the index of their attractor.

    • InitialSamplePoints (list[int]): The initial sample points used (if provided, they are returned; otherwise, the ‘nsim’ generated points are returned).

    • STG (dict[int:int]): A sample of the state transition graph as dictionary, with each state represented by its decimal representation.

    • NumberOfTimeouts (int): Number of simulations that timed out before reaching an attractor. Increase ‘n_steps_timeout’ to reduce this number.

compute_synchronous_state_transition_graph() dict[source]

Compute the entire synchronous state transition graph (STG) using Numba for high performance.

Returns:

  • dict[int:int]: A dictionary representing the state transition graph of the network, where each key represents the current state and its corresponding value the next state.

get_attractors_synchronous_exact() dict[source]

Compute the exact number of attractors in a Boolean network using a fast, vectorized approach.

This function computes all attractors and their basin sizes from the the full state transition graph.

Returns:

  • dict[str:Variant]: A dictionary containing:

    • Attractors (list[list[int]]): List of attractors (each attractor is represented as a list of states forming the cycle).

    • NumberOfAttractors (int): Total number of unique attractors.

    • BasinSizes (list[int]): List of counts for each attractor.

    • AttractorDict (dict[int:int]): Dictionary mapping each state (in decimal) to its attractor index.

    • STG (dict[int:int]): The state transition graph as dictionary, with each state represented by its decimal representation.

get_derrida_value(nsim: int = 1000, EXACT: bool = False, *, rng=None) float[source]

Estimate the Derrida value for a Boolean network.

The Derrida value is computed by perturbing a single node in a randomly chosen state and measuring the average Hamming distance between the resulting updated states of the original and perturbed networks.

Parameters:

  • nsim (int, optional): Number of simulations to perform. Default is 1000.

  • EXACT (bool, optional): If True, the exact Derrida value is computed and ‘nsim’ is ignored. Otherwise, ‘nsim’ simulations are used to approximate the Derrida value.

  • rng (None, optional): Argument for the random number generator, implemented in ‘utils._coerce_rng’.

Returns:

  • float: The average Hamming distance (Derrida value) over nsim simulations.

References:

  1. Derrida, B., & Pomeau, Y. (1986). Random networks of automata: a simple annealed approximation. Europhysics letters, 1(2), 45.

get_attractors_and_robustness_measures_synchronous_exact() dict[source]

Compute the attractors and several robustness measures of a Boolean network.

This function computes the exact attractors and robustness (coherence and fragility) of the entire network, as well as robustness measures for each basin of attraction and each attractor.

Returns:

  • dict[str:Variant]: A dictionary containing:

    • Attractors (list[list[int]]): List of attractors (each attractor is represented as a list of state decimal numbers).

    • ExactNumberOfAttractors (int): The exact number of network attractors.

    • BasinSizes (list[int]): List of exact basin sizes for each attractor.

    • AttractorDict (dict[int:int]): Dictionary mapping each state (in decimal) to its attractor index.

    • Coherence (float): overall exact network coherence

    • Fragility (float): overall exact network fragility

    • BasinCoherence (list[float]): exact coherence of each basin.

    • BasinFragility (list[float]): exact fragility of each basin.

    • AttractorCoherence (list[float]): exact coherence of each attractor.

    • AttractorFragility (list[float]): exact fragility of each attractor.

References:

  1. Park, K. H., Costa, F. X., Rocha, L. M., Albert, R., & Rozum, J. C. (2023). Models of cell processes are far from the edge of chaos. PRX life, 1(2), 023009.

  2. Bavisetty, V. S. N., Wheeler, M., & Kadelka, C. (2025). xxxx arXiv preprint arXiv:xxx.xxx.

get_attractors_and_robustness_measures_synchronous(number_different_IC: int = 500, RETURN_ATTRACTOR_COHERENCE: bool = True, *, rng=None) dict[source]

Approximate global robustness measures and attractors.

This function samples the attractor landscape by simulating the network from a number of different initial conditions. It computes:

  • The coherence: the proportion of neighboring states (in the Boolean hypercube) that, after synchronous update, transition to the same attractor.

  • The fragility: a measure of how much the attractor state changes (assumed under synchronous update) in response to perturbations.

  • The final time-step Hamming distance between perturbed trajectories.

In addition, it collects several details about each attractor (such as basin sizes, coherence of each basin, etc.).

Parameters:

  • number_different_IC (int, optional): Number of different initial conditions to sample (default is 500).

  • RETURN_ATTRACTOR_COHERENCE (bool, optional): Determines whether the attractor coherence should also be computed (default True, i.e., Yes).

  • rng (None, optional): Argument for the random number generator, implemented in ‘utils._coerce_rng’.

Returns:

  • dict[str:Variant]: A dictionary containing:

    • Attractors (list[list[int]]): List of attractors (each attractor is represented as a list of state decimal numbers).

    • LowerBoundOfNumberOfAttractors (int): The lower bound on the number of attractors found.

    • BasinSizes (list[int]): List of basin sizes for each attractor.

    • CoherenceApproximation (float): The approximate overall network coherence.

    • FragilityApproximation (float): The approximate overall network fragility.

    • FinalHammingDistanceApproximation (float): The approximate final Hamming distance measure.

    • BasinCoherenceApproximation (list[float]): The approximate coherence of each basin.

    • BasinFragilityApproximation (list[float]): The approximate fragility of each basin.

    • AttractorCoherence (list[float]): The exact coherence of each attractor (only computed and returned if RETURN_ATTRACTOR_COHERENCE == True).

    • AttractorFragility (list[float]): The exact fragility of each attractor (only computed and returned if RETURN_ATTRACTOR_COHERENCE == True).

References:

  1. Park, K. H., Costa, F. X., Rocha, L. M., Albert, R., & Rozum, J. C. (2023). Models of cell processes are far from the edge of chaos. PRX life, 1(2), 023009.

  2. Bavisetty, V. S. N., Wheeler, M., & Kadelka, C. (2025). xxxx arXiv preprint arXiv:xxx.xxx.