discrete_optimization.shop.fjsp.transformations package

Submodules

discrete_optimization.shop.fjsp.transformations.to_rcpsp module

Transformation from FlexibleJobShop to RCPSP.

class discrete_optimization.shop.fjsp.transformations.to_rcpsp.FjspToRcpspTransformation[source]

Bases: ProblemTransformation[FJobShopProblem, AnyShopSolution, RcpspProblem, RcpspSolution]

Transform FlexibleJobShop to RCPSP.

Mapping: - (job_j, subjob_k) → task_{j}_{k} - Machine options → modes for each task - Machines → renewable resources (capacity 1) - Processing time on machine → duration for that mode - Job precedence → task successors

This allows using RCPSP solvers for flexible job shop problems.

back_transform_solution(solution: RcpspSolution, source_problem: FJobShopProblem) AnyShopSolution[source]

Transform RCPSP solution back to FlexibleJobShop solution.

Parameters:
  • solution – RCPSP solution

  • source_problem – Original FlexibleJobShop problem

Returns:

Equivalent FlexibleJobShop solution

forward_transform_solution(solution: AnyShopSolution, target_problem: RcpspProblem) RcpspSolution | None[source]

Transform FlexibleJobShop solution to RCPSP solution (for warm-start).

Parameters:
  • solution – FlexibleJobShop solution

  • target_problem – Target RCPSP problem

Returns:

Equivalent RCPSP solution for warm-start

transform_problem(source_problem: FJobShopProblem) RcpspProblem[source]

Transform FlexibleJobShop to RCPSP.

Parameters:

source_problem – FlexibleJobShop problem instance

Returns:

Equivalent RCPSP problem

discrete_optimization.shop.fjsp.transformations.to_workforce module

Transformation from Flexible Job Shop to Workforce Scheduling.

This is the inverse of WorkforceScheduling → FJSP. Operations are mapped to tasks, machines to teams.

class discrete_optimization.shop.fjsp.transformations.to_workforce.FjspToWorkforceSchedulingTransformation[source]

Bases: ProblemTransformation[FJobShopProblem, AnyShopSolution, AllocSchedulingProblem, AllocSchedulingSolution]

Transform Flexible Job Shop to Workforce Scheduling.

Mapping: - Operations → Tasks - Machines → Teams - Eligible machines → Available teams for task - Operation duration → Task duration - Job precedence → Task precedence

This transformation is EXACT: - All FJSP constraints preserved in workforce scheduling - Machines become teams (resources) - Operations become tasks with team eligibility

back_transform_solution(solution: AllocSchedulingSolution, source_problem: FJobShopProblem) AnyShopSolution[source]

Transform Workforce Scheduling solution back to FJSP.

Parameters:
  • solution – AllocSchedulingSolution

  • source_problem – Original FJobShopProblem

Returns:

Equivalent FJobShopSolution

forward_transform_solution(solution: AnyShopSolution, target_problem: AllocSchedulingProblem) AllocSchedulingSolution | None[source]

Transform FJSP solution to Workforce Scheduling (for warmstart).

Parameters:
  • solution – FJobShopSolution

  • target_problem – Target AllocSchedulingProblem

Returns:

Equivalent AllocSchedulingSolution

get_forward_metadata() TransformationMetadata[source]

Metadata for forward problem transformation (FJSP → WorkforceScheduling).

This direction is EXACT: all FJSP information preserved.

transform_problem(source_problem: FJobShopProblem) AllocSchedulingProblem[source]

Transform FJSP to Workforce Scheduling.

Parameters:

source_problem – FJobShopProblem instance

Returns:

Equivalent AllocSchedulingProblem

Module contents

Problem transformations for FlexibleJobShop.

class discrete_optimization.shop.fjsp.transformations.FjspToRcpspTransformation[source]

Bases: ProblemTransformation[FJobShopProblem, AnyShopSolution, RcpspProblem, RcpspSolution]

Transform FlexibleJobShop to RCPSP.

Mapping: - (job_j, subjob_k) → task_{j}_{k} - Machine options → modes for each task - Machines → renewable resources (capacity 1) - Processing time on machine → duration for that mode - Job precedence → task successors

This allows using RCPSP solvers for flexible job shop problems.

back_transform_solution(solution: RcpspSolution, source_problem: FJobShopProblem) AnyShopSolution[source]

Transform RCPSP solution back to FlexibleJobShop solution.

Parameters:
  • solution – RCPSP solution

  • source_problem – Original FlexibleJobShop problem

Returns:

Equivalent FlexibleJobShop solution

forward_transform_solution(solution: AnyShopSolution, target_problem: RcpspProblem) RcpspSolution | None[source]

Transform FlexibleJobShop solution to RCPSP solution (for warm-start).

Parameters:
  • solution – FlexibleJobShop solution

  • target_problem – Target RCPSP problem

Returns:

Equivalent RCPSP solution for warm-start

transform_problem(source_problem: FJobShopProblem) RcpspProblem[source]

Transform FlexibleJobShop to RCPSP.

Parameters:

source_problem – FlexibleJobShop problem instance

Returns:

Equivalent RCPSP problem

class discrete_optimization.shop.fjsp.transformations.FjspToWorkforceSchedulingTransformation[source]

Bases: ProblemTransformation[FJobShopProblem, AnyShopSolution, AllocSchedulingProblem, AllocSchedulingSolution]

Transform Flexible Job Shop to Workforce Scheduling.

Mapping: - Operations → Tasks - Machines → Teams - Eligible machines → Available teams for task - Operation duration → Task duration - Job precedence → Task precedence

This transformation is EXACT: - All FJSP constraints preserved in workforce scheduling - Machines become teams (resources) - Operations become tasks with team eligibility

back_transform_solution(solution: AllocSchedulingSolution, source_problem: FJobShopProblem) AnyShopSolution[source]

Transform Workforce Scheduling solution back to FJSP.

Parameters:
  • solution – AllocSchedulingSolution

  • source_problem – Original FJobShopProblem

Returns:

Equivalent FJobShopSolution

forward_transform_solution(solution: AnyShopSolution, target_problem: AllocSchedulingProblem) AllocSchedulingSolution | None[source]

Transform FJSP solution to Workforce Scheduling (for warmstart).

Parameters:
  • solution – FJobShopSolution

  • target_problem – Target AllocSchedulingProblem

Returns:

Equivalent AllocSchedulingSolution

get_forward_metadata() TransformationMetadata[source]

Metadata for forward problem transformation (FJSP → WorkforceScheduling).

This direction is EXACT: all FJSP information preserved.

transform_problem(source_problem: FJobShopProblem) AllocSchedulingProblem[source]

Transform FJSP to Workforce Scheduling.

Parameters:

source_problem – FJobShopProblem instance

Returns:

Equivalent AllocSchedulingProblem