proc_opt/
lib.rs

1//! This crate provides job/process scheduling optimization algorithms.
2//!
3//! # A job or a process
4//!
5//! A job or a process is described using three values:
6//!
7//! * `r` - ready time
8//! * `p` - process time
9//! * `q` - cooldown/quit time
10//!
11#![doc=include_str!("../img/job.svg")]
12//!
13//! `r` - Time it takes for this process to become available form time `0`. For example after turning on a machine it may take some time for some of its features to become available due to a certain constraints. A trivial example is that of cooking, a grill or any other device that allows thermal treatment for given food needs to achieve a certain temperature otherwise it will not be effective.
14//!
15//! `p` - Time taken by the process itself. It is the time taken by the modeled mechanism itself to perform a given function. Following the cooking example it can be modeled as the actual time that a given food has to be cooked for on the grill.
16//!
17//! `q` - Time that it takes for the machine to clean-up/cooldown/quit after executing a given process. Again, following the cooking example it can be described as the time needed to clean-up after serving the cooked food.
18//!
19//! `C` - The final time when the machine finishes dealing with any part of the process/job.
20//!
21//!
22//! # Scheduling problems
23//!
24//! There exist two types of job scheduling problems. The first one being *single-machine* problem and the second being *multi-machine* problem.
25//! Each of them agrees with these assumptions:
26//! 1. First being that jobs ona a single machine cannot have their processing time shared simultaneously between processes.
27//! 2. The readying time and quitting time can overlap.
28//! 3. The whole of the machines process end when the last job finishes.
29//!
30//!
31//! An example set of jobs and their natural (from the 1 to $j$'th) arrangement:
32//!
33//! <div align="center">
34//!
35//! |$j$  |1    |2    |3    |4    |5    |6    |7    |
36//! |:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
37//! |$r_j$|10   |13   |11   |20   |30   |0    |30   |
38//! |$p_j$|5    |6    |7    |4    |3    |6    |2    |
39//! |$q_j$|7    |26   |24   |21   |8    |17   |0    |
40//!
41//! </div>
42//!
43#![doc=include_str!("../img/schrage_natural.svg")]
44//!
45//! $C_{max}$ - being the maximum time out of all of the finishing times for all the jobs. It is therefore also the time at which the whole machine finishes work.
46//!
47//! Here we can see the actual optimal arrangement for the same jobs, where the $C_{max}$ is minimized down to $50$:
48//!
49#![doc=include_str!("../img/optimal.svg")]
50//!
51//! # Single-machine problem
52//!
53//! Meta-heuristic algorithms (giving fast but approximate answer):
54//! * Schrage algorithm - [`schrage`]
55//! * Part Time Schrage (TBD)
56//!
57//! Heuristic algorithms (giving slower but optimal answer):
58//! * Carlier (TBD)
59//!
60//! # Multi-machine problem
61//! TBD
62//!
63
64// cargo doc dark theme background color: #353535
65#![forbid(unsafe_code)]
66
67pub mod jobs;
68pub mod schrage;