Skip to content

MrPascalCase/SbbChallenge

Repository files navigation

On Job-Insertion for the Blocking-Job-Shop and its Application to the SBB Challenge

drawing

(Image: A visualization of a precedence constraint graph representing a time table.)

On this github repository you find my master thesis & project.

The SBB (swiss federal railways) challenge is a time table generation problem. At the core this is a blocking-job-shop scheduling problem: Given is a set of jobs (trains) each has to go through a set of operations. Operations conflict if they use the same machine (track segment). Each machine can only be used by one job at a time. The aim is, to assign conflict free entry times, such that the delay is minimized. A main complication comes form the blocking nature of the problem: a machine is only freed, when a job moved to the next.

The links to the challenge:

Dependencies

  • .Net Framework v4.7.2 (or later), which includes

    • mscorlib, System
    • System.Web.Extension (only used for the SBB json input parsing)
    • System.Xml (only used to convert SBB time stamps)
    • System.Drawing (only used for color names to generate debug svg output)
  • dot / graphviz if you want to output debug visualizations (such as the image above, https://graphviz.org/)

Usage (eg. Linux/Mono)

$ cd SbbChallenge/
$ msbuild SbbChallenge.csproj
$ mono obj/SbbChallenge.exe <PathToProblem> [-s <Seed>] [-i <MaxIterations>] [-t <MaxSearchSeconds>] [-r <MaxRoutesToConsiderPerJob>] 

Documentation

The code is mostly documented though interfaces and comments. Here by an quick overview of the project organization. We have the following name spaces:

  • IntegrityChecks: fancy asserts. There are many, and some are so slow, that it became necessary to enable/disable and document them.

  • Helpers: some LINQ-like extensions and basic data types. Of note is the class Graph which implements a forward/backward adjacency list graph (vertices : int, edges labeled with (machineId : int) * (length : TimeSpan)).

  • ProblemDefintion: IProblem defines the blocking-job-shop problem general enough, that both, instances studied in academia and the problems provided by SBB are modelled as such. The class Problem (immutable) is constructed form an IProblem and caches/preprocesses various things. ProblemTransformation provided IProblem extension methods to remove unnecessary Routes/Machines/Operations.

  • InputProblem: Constructs the SBB (or academic literature) blocking-job-shop problem from json (or txt) files. Implements ProblemDefinition.IProblem.

  • Visualization: Can create svg debug output for the precedence-constraint graphs we are working with.

  • Search: The algorithm provides a neighborhood. This runs a taboo-search to find a local optimum. It is kept as simple as possible.

  • Layers: The core of the algorithm. I tried to split the algorithm into reasonable modules to increase readability and to make modifications/experiments easier. Guiding principles are single responsibility and avoidance of cyclic dependencies. At the bottom of the resulting layered approach we have a ISolution (representing the vector t in the thesis). Built on-top we have layers which expose ever more complex modifications of the ISolution. While the modifications increase in complexity, they come closer to maintaining the feasibility of solutions. Note, the file Layers._Interfaces.cs, which both enforces some modularity and provides some overview/documentation, is a good starting point to read the code.

drawing

Most important references

Gröflin H, Klinkert A (2007) Feasible insertions in job shop scheduling, short cycles and stable sets

Gröflin H, Klinkert A (2009) A new neighborhood and tabu search for the Blocking Job Shop

Bürgy R (2017) A neighborhood for complex job shop scheduling problems with regular objectives

Bürgy R, Gröflin H (2017) The no-wait job shop with regular objective: a method based on optimal job insertion

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages