FICO
FICO Xpress Optimization Examples Repository
FICO Optimization Community FICO Xpress Optimization Home
Back to examples browserPrevious exampleNext example

Scheduling problems

Description
Problem name and type, featuresDifficultyRelated examples
B‑1 Construction of a stadium: Project scheduling (Method of Potentials) *** projplan_graph.mos
2 problems; selection with `|', sparse/dense format, naming and redefining constraints, subroutine: procedure for solution printing, forward declaration, array of set
B‑2 Flow shop scheduling **** flowshop_graph.mos
alternative formulation using SOS1
B‑3 Job shop scheduling *** jobshop_graph.mos
formulating disjunctions (BigM); dynamic array, range, exists, forall-do,array of set, array of list
B‑4 Sequencing jobs on a bottleneck machine: Single machine scheduling *** sequencing_graph.mos
3 different objectives; subroutine: procedure for solution printing, localsetparam, if-then
B‑5 Paint production: Asymmetric Traveling Salesman Problem (TSP) ***
solution printing, repeat-until, cast to integer, selection with `|', round
B‑6 Assembly line balancing ** linebal_graph.mos
encoding of arcs, range


Further explanation of this example: 'Applications of optimization with Xpress-MP', Chapter 7: Scheduling problems

mosel_app_2.zip[download all files]

Source Files

Data Files





b6linebal.mos

(!******************************************************
   Mosel Example Problems
   ======================

   file b6linebal.mos
   ``````````````````
   Assembly line balancing
   
   An electronics factory has 4 workstations that can 
   produce amplifiers. Each amplifier has 12 production 
   steps. The manager would like to distribute these steps
   across the workstations to balance the workload and complete
   the amplifiers in the shortest possible time. Each step
   must be assigned a workstation and each station can only
   have one step at a time. Which steps should be assigned to
   each station to achieve the fastest amplifier production time?
   
   This mixed integer problem uses 'ARC' to define the relationship
   between steps and their predecessors. Binary variables are used
   to assign tasks to stations (machines).

   (c) 2008-2022 Fair Isaac Corporation
       author: S. Heipcke, Mar. 2002, rev. Mar. 2022
*******************************************************!)

model "B-6 Assembly line balancing"
 uses "mmxprs"

 declarations   
  MACH=1..4                             ! Set of workstations
  TASKS=1..12                           ! Set of tasks

  DUR: array(TASKS) of integer          ! Durations of tasks
  ARC: array(RA:range, 1..2) of integer ! Precedence relations between tasks

  process: array(TASKS,MACH) of mpvar   ! 1 if task on machine, 0 otherwise
  cycle: mpvar                          ! Duration of a production cycle
 end-declarations

 initializations from 'b6linebal.dat'
  DUR ARC 
 end-initializations

! One workstation per task
 forall(i in TASKS) sum(m in MACH) process(i,m) = 1

! Sequence of tasks
 forall(a in RA) sum(m in MACH) m*process(ARC(a,1),m) <=
                  sum(m in MACH) m*process(ARC(a,2),m)

! Cycle time
 forall(m in MACH) sum(i in TASKS) DUR(i)*process(i,m) <= cycle

 forall(i in TASKS, m in MACH) process(i,m) is_binary

! Minimize the duration of a production cycle
 minimize(cycle)
 
! Solution printing
 writeln("Minimum cycle time: ", getobjval)
 forall(m in MACH) do
  write("Workstation ", m, ":")
  forall(i in TASKS | getsol(sum(k in MACH) k*process(i,k)) = m) write(" ", i) 
  writeln(" (duration: ", getsol(sum(i in TASKS) DUR(i)*process(i,m)),")")
 end-do  
 
end-model

Back to examples browserPrevious exampleNext example