corneto.methods.CarnivalILP#
- class corneto.methods.CarnivalILP(beta_weight=0.2, max_dist=None, penalize='edges', use_perturbation_weights=False, interaction_graph_attribute='interaction', disable_acyclicity=False, data_type_key='role', data_input_key='input', data_output_key='output', backend=None)#
Bases:
_CarnivalUserInputs,MethodMulti-condition implementation of the CARNIVAL ILP formulation.
Each sample in
corneto.data.Datareceives an independent signaling state on a shared network. Binary variables and ILP constraints model signal propagation without the flow formulation used byCarnivalFlow.- Parameters:
beta_weight (float) – Regularization term weight. Default: 0.2
max_dist (int | None) – Max distance between vertices. If None, uses vertex count. Default: None
penalize (str) – What to regularize - ‘nodes’/’edges’/’both’. Default: ‘edges’
use_perturbation_weights (bool) – Include perturbation weights. Default: False
interaction_graph_attribute (str) – Edge attribute for interactions. Default: ‘interaction’
disable_acyclicity (bool) – Skip acyclicity constraints. Default: False
backend (Backend | None) – Optimization backend. Default: None
data_type_key (str)
data_input_key (str)
data_output_key (str)
- __init__(beta_weight=0.2, max_dist=None, penalize='edges', use_perturbation_weights=False, interaction_graph_attribute='interaction', disable_acyclicity=False, data_type_key='role', data_input_key='input', data_output_key='output', backend=None)#
Methods
__init__([beta_weight, max_dist, penalize, ...])build(pkn[, data, perturbations, ...])Build from a
Dataobject.build_from_data(graph[, data])Build the complete optimization problem.
build_many(pkn, *, perturbations, ...)create_problem(graph, data)Create the ILP optimization problem.
description()Returns a description of the method.
name()Returns the name of the method.
preprocess(graph, data)Preprocess the input graph and dataset before optimization.
Returns citation keys for this method.
show_bibtex()Display raw BibTeX entries in a formatted block for easy copying.
show_references()Display formatted citations in a Jupyter notebook.
Attributes
backendReturn the optimization backend being used.
- preprocess(graph, data)#
Preprocess the input graph and dataset before optimization.
This method performs: 1. Graph pruning based on input conditions to remove irrelevant vertices 2. Data standardization for optimization
- create_problem(graph, data)#
Create the ILP optimization problem.
This method implements the core CARNIVAL optimization problem by: 1. Creating binary variables for vertex and edge states 2. Setting up consistency constraints 3. Adding acyclicity constraints if enabled 4. Incorporating measurements into the objective
- static references()#
Returns citation keys for this method.
- Returns:
A list of citation keys that can be used to lookup BibTeX entries.