discrete_optimization.shop.jsp.transformations package

Submodules

discrete_optimization.shop.jsp.transformations.to_fjsp module

Transformation from JobShop to FlexibleJobShop. With new common API for shop-problems, there is no really transformation needed.

class discrete_optimization.shop.jsp.transformations.to_fjsp.JspToFjspTransformation[source]

Bases: ProblemTransformation[JobShopProblem, JobShopSolution, FJobShopProblem, AnyShopSolution]

Transform JobShop to FlexibleJobShop.

Mapping: - Each subjob with fixed machine → subjob with 1 machine option - Job structure preserved - Precedence within jobs preserved

JobShop is a special case of FlexibleJobShop where each operation can only be processed on exactly one machine.

back_transform_solution(solution: AnyShopSolution, source_problem: JobShopProblem) JobShopSolution[source]

Transform FlexibleJobShop solution back to JobShop solution.

Parameters:
  • solution – FlexibleJobShop solution

  • source_problem – Original JobShop problem

Returns:

Equivalent JobShop solution

forward_transform_solution(solution: JobShopSolution, target_problem: FJobShopProblem) AnyShopSolution | None[source]

Transform JobShop solution to FlexibleJobShop solution (for warmstart).

Parameters:
  • solution – JobShop solution

  • target_problem – Target FlexibleJobShop problem

Returns:

Equivalent FlexibleJobShop solution for warmstart

transform_problem(source_problem: JobShopProblem) FJobShopProblem[source]

Transform JobShop to FlexibleJobShop.

Parameters:

source_problem – JobShop problem instance

Returns:

Equivalent FlexibleJobShop problem

Module contents

Problem transformations for JobShop.

class discrete_optimization.shop.jsp.transformations.JspToFjspTransformation[source]

Bases: ProblemTransformation[JobShopProblem, JobShopSolution, FJobShopProblem, AnyShopSolution]

Transform JobShop to FlexibleJobShop.

Mapping: - Each subjob with fixed machine → subjob with 1 machine option - Job structure preserved - Precedence within jobs preserved

JobShop is a special case of FlexibleJobShop where each operation can only be processed on exactly one machine.

back_transform_solution(solution: AnyShopSolution, source_problem: JobShopProblem) JobShopSolution[source]

Transform FlexibleJobShop solution back to JobShop solution.

Parameters:
  • solution – FlexibleJobShop solution

  • source_problem – Original JobShop problem

Returns:

Equivalent JobShop solution

forward_transform_solution(solution: JobShopSolution, target_problem: FJobShopProblem) AnyShopSolution | None[source]

Transform JobShop solution to FlexibleJobShop solution (for warmstart).

Parameters:
  • solution – JobShop solution

  • target_problem – Target FlexibleJobShop problem

Returns:

Equivalent FlexibleJobShop solution for warmstart

transform_problem(source_problem: JobShopProblem) FJobShopProblem[source]

Transform JobShop to FlexibleJobShop.

Parameters:

source_problem – JobShop problem instance

Returns:

Equivalent FlexibleJobShop problem