corneto.methods.PrizeCollectingSteinerTree#

class corneto.methods.PrizeCollectingSteinerTree(include_all_terminals=False, 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=False, backend=None)#

Bases: FlowMethod

Prize-Collecting Steiner Tree optimization method built on top of FlowMethod.

In a prize-collecting Steiner tree problem, terminals can have prizes (values > 0), making them optional terminals that provide a benefit if included in the solution. The class supports providing multiple max_flow and root_vertex values per sample.

Parameters:
__init__(include_all_terminals=False, 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=False, backend=None)#
Parameters:

Methods

__init__([include_all_terminals, max_flow, ...])

build(graph[, data, prizes, terminals, ...])

Build a single-condition PCST problem from explicit inputs.

build_from_data(graph[, data])

Build the complete optimization problem.

build_many(graph, *, prizes[, terminals, ...])

Build a multi-condition PCST problem from named condition mappings.

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

backend

Return the optimization backend being used.

build(graph, data=None, *, prizes=None, terminals=None, edge_costs=None)#

Build a single-condition PCST problem from explicit inputs.

Parameters:
build_many(graph, *, prizes, terminals=None, edge_costs=None)#

Build a multi-condition PCST problem from named condition mappings.

Parameters:

graph (BaseGraph)

preprocess(graph, data)#

Preprocess the graph and data.

Parameters:
Return type:

Tuple[BaseGraph, Data]

get_flow_bounds(graph, data)#

Get the flow bounds for the optimization problem.

Parameters:
Return type:

Dict[str, Any]

create_flow_based_problem(flow_problem, graph, data)#

Create the flow-based optimization problem.

Parameters: