jijzepttools.modeling.algorithm.dantzig_wolfe_decomposition.generate#

Classes#

MasterProblemVariables

Masterproblem variables

SubProblemVariables

Masterproblem variables

Functions#

generate_master_problem(→ jijmodeling.Problem)

Generate master problem of Dantzig-Wolfe decomposition.

generate_master_problem_legacy(→ jijmodeling.Problem)

Legacy version of generate_master_problem for backward compatibility.

generate_sub_problem(→ List[jijmodeling.Problem])

Module Contents#

class MasterProblemVariables#

Masterproblem variables

u#

decision variables of master problem

Type:

DecisionVar

p#

placeholder of decision variables

Type:

jm.Element

ph#

placeholders of decision variables, key is the name of decision variable

Type:

tp.Dict[str, jm.Placeholder]

u: jijzepttools.modeling.utils.type.DecisionVar#
p: jijmodeling.Element#
ph: Dict[str, jijmodeling.Placeholder]#
generate_master_problem(problem_name: str, sum_one_constraint_name: str, objective: jijzepttools.modeling.utils.type.Expr, overlapped_constraints: List[jijmodeling.Constraint], vars: MasterProblemVariables, sparse_variables: List[str], disjoint_forall_holder: jijzepttools.modeling.algorithm.dantzig_wolfe_decomposition.utils.DisjointForallHolder, var_ref: List[jijmodeling.Subscript] = None) jijmodeling.Problem#

Generate master problem of Dantzig-Wolfe decomposition.

This function transforms the original problem into a master problem using column generation variables. It uses DisjointForallHolder with None conditions to create a unified formulation without splitting. The decision variables are replaced with convex combination weights u.

The generated master problem will have the following form: - Objective: sum(p, u[indices…, p] * transformed_objective) - Constraints: transformed_lhs == rhs for each overlapped constraint - Sum-one constraint: sum(p, u[indices…, p]) == 1 for each combination of forall indices

Parameters:
  • problem_name (str) – name of master problem

  • sum_one_constraint_name (str) – name of sum one constraint

  • objective (Expr) – objective function from the original problem

  • overlapped_constraints (tp.List[jm.Constraint]) – constraints that couple different subproblems

  • vars (MasterProblemVariables) – variables for the master problem including: - u: convex combination weights with shape (…forall_indices, P) - p: column index element - ph: placeholders for original decision variables

  • sparse_variables (tp.List[str]) – list of sparse variables (currently unused)

  • disjoint_forall_holder (DisjointForallHolder) – holder containing the forall indices from the decomposition structure

  • var_ref (tp.List[jm.Subscript], optional) – variable references for complex index transformations. Defaults to None.

Returns:

master problem with column generation formulation

Return type:

jm.Problem

generate_master_problem_legacy(problem_name: str, sum_one_constraint_name: str, objective: jijzepttools.modeling.utils.type.Expr, overlapped_constraints: List[jijmodeling.Constraint], vars: MasterProblemVariables, sparse_variables: List[str]) jijmodeling.Problem#

Legacy version of generate_master_problem for backward compatibility.

This function maintains the old interface where u has shape (P,) and uses the original transformation logic without DisjointForallHolder.

Parameters:
  • problem_name (str) – name of master problem

  • sum_one_constraint_name (str) – name of sum one constraint

  • objective (Expr) – objective function

  • overlapped_constraints (tp.List[jm.Constraint]) – overlapped constraints

  • vars (MasterProblemVariables) – variables of master problem

  • sparse_variables (tp.List[str]) – list of sparse variables

Returns:

master problem

Return type:

jm.Problem

class SubProblemVariables#

Masterproblem variables

lambd#

placeholders of dual variables, key is the name of constraints (only overlapped constraints are used)

Type:

tp.Dict[str, jm.Placeholder]

lambd: Dict[str, jijmodeling.Placeholder]#
generate_sub_problem(problem_name: str, objective: jijzepttools.modeling.utils.type.Expr, separated_constraints: List[List[jijmodeling.Constraint]], overlapped_constraints: List[jijmodeling.Constraint], vars: SubProblemVariables, disjoint_forall_holder: jijzepttools.modeling.algorithm.dantzig_wolfe_decomposition.utils.DisjointForallHolder, var_ref: List[jijmodeling.Subscript], add_overlapped_term_to_objective: bool = True, obj_expr_filter: Callable[[jijzepttools.modeling.utils.type.Expr], bool] = lambda expr: ...) List[jijmodeling.Problem]#