corneto.methods.SteinerTreeFlow#
- class corneto.methods.SteinerTreeFlow(max_flow=None, default_edge_cost=1.0, flow_name='_flow', root_vertex=None, root_selection_strategy='first', best_root_candidates='data', epsilon=1, strict_acyclic=True, disable_structured_sparsity=False, in_flow_edge_type=EdgeType.DIRECTED, out_flow_edge_type=EdgeType.DIRECTED, lambda_reg=0.0, force_flow_through_root=True, backend=None)#
Bases:
PrizeCollectingSteinerTreeBasic Steiner Tree optimization method as a flow-based problem.
Given a graph and a set of terminal nodes, this method finds a minimal-weight connected subgraph (tree) that spans all terminals.
- Parameters:
default_edge_cost (float)
flow_name (str)
root_selection_strategy (Literal['first', 'best'])
best_root_candidates (Literal['data', 'graph'])
epsilon (float)
strict_acyclic (bool)
disable_structured_sparsity (bool)
in_flow_edge_type (EdgeType)
out_flow_edge_type (EdgeType)
lambda_reg (float)
force_flow_through_root (bool)
backend (Backend | None)
- __init__(max_flow=None, default_edge_cost=1.0, flow_name='_flow', root_vertex=None, root_selection_strategy='first', best_root_candidates='data', epsilon=1, strict_acyclic=True, disable_structured_sparsity=False, in_flow_edge_type=EdgeType.DIRECTED, out_flow_edge_type=EdgeType.DIRECTED, lambda_reg=0.0, force_flow_through_root=True, backend=None)#
- Parameters:
default_edge_cost (float)
flow_name (str)
root_selection_strategy (Literal['first', 'best'])
best_root_candidates (Literal['data', 'graph'])
epsilon (float)
strict_acyclic (bool)
disable_structured_sparsity (bool)
in_flow_edge_type (EdgeType)
out_flow_edge_type (EdgeType)
lambda_reg (float)
force_flow_through_root (bool)
backend (Backend | None)
Methods
__init__([max_flow, default_edge_cost, ...])build(graph[, data, terminals, edge_costs])Build a single-condition Steiner tree from explicit inputs.
build_from_data(graph[, data])Build the complete optimization problem.
build_many(graph, *, terminals[, edge_costs])Build multiple named Steiner tree conditions.
create_flow_based_problem(flow_problem, ...)Create the flow-based optimization problem.
create_problem(graph, data)Create the optimization problem using a flow-based formulation.
description()Returns a description of the method.
get_flow_bounds(graph, data)Get the flow bounds for the optimization problem.
name()Returns the name of the method.
preprocess(graph, data)Preprocess the graph and data.
references()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.
- build(graph, data=None, *, terminals=None, edge_costs=None)#
Build a single-condition Steiner tree from explicit inputs.
- build_many(graph, *, terminals, edge_costs=None)#
Build multiple named Steiner tree conditions.