Chapter 12 Case Studies Part C. Schedule Optimization.

35
Chapter 12 Case Studies Part C

Transcript of Chapter 12 Case Studies Part C. Schedule Optimization.

Page 1: Chapter 12 Case Studies Part C. Schedule Optimization.

Chapter 12Case Studies

Part C

Page 2: Chapter 12 Case Studies Part C. Schedule Optimization.

Schedule Optimization

Page 3: Chapter 12 Case Studies Part C. Schedule Optimization.

Schedule Optimization

• One of the most common applications of EC optimization

• Scheduling optimization is an NP-Complete problem

• NP-Complete: Sufficiently complex such that any deterministicsearch technique that completely searches the problemdomain will probably not find an acceptable answer in anacceptable time

• First case study summary based on the work of Syswerda andPalmucci

• Second case study summary based on logistics optimization done at IUPUI

Page 4: Chapter 12 Case Studies Part C. Schedule Optimization.

The Facility Scheduling Example

• Syswerda/Palmucci developed scheduler for U. S. Navy teststation laboratory with aircraft simulators

• Schedulers usually schedule tasks

• A task is a time and resource requirement

• Basic decision for any scheduling project is selection of timeblock; one-hour blocks selected in this case

Page 5: Chapter 12 Case Studies Part C. Schedule Optimization.

Available Time and Resources

• 5 days/week; 16 hours/day

• Run scheduler one week at a time

• Scheduler must be able to run manually, or for only a part of theweek at a time

• In this case study, there are 40 categories of equipmentresources, with multiple instances of some

• Five time preference levels (preemptory – neutral – illegal)

• More time is spent on rescheduling than on scheduling

Page 6: Chapter 12 Case Studies Part C. Schedule Optimization.

Constraints

• Two major types of constraints exist: hard (strong) andsoft (weak)

• Hard constraints cannot be violated by scheduler.> Examples: scheduled maintenance> Can sometimes be overridden manually

• Soft constraints can be violated with a penalty assigned to fitness function. Examples are time and resource preferences

Page 7: Chapter 12 Case Studies Part C. Schedule Optimization.

Transportation Resource Scheduling Example

• Multi-location corporation that manufactures electro-mechanical systems

• Schedule the shipping of sub-assemblies from warehouse to three final assembly facilities

• Facilities A1, A2, and A3 are 10 km equidistant; W and A1 are 20 km apart

• Two types of cargo: pallets (two types) and cartons (two types)

• Two types of trucks: heavy and light

• Heavy trucks and pallets go only to A1

• Light trucks go anywhere but carry only cartons

Page 8: Chapter 12 Case Studies Part C. Schedule Optimization.

Geometry of Transportation Resource Scheduling Example

Page 9: Chapter 12 Case Studies Part C. Schedule Optimization.

Transportation Resource Scheduling Example, Continued

• Orders are placed 6-8 hours in advance

• Delivery is desired within a two-hour time window

• Only one order per facility for each two-hour time window

• Orders can be split among trucks

• One truck can carry items for multiple facilities

• Capability to reschedule is critical

Page 10: Chapter 12 Case Studies Part C. Schedule Optimization.

Major Components of Scheduling System

The three major components listed below are common to manyscheduling systems

* Schedule Builder> Major job is to build “legal” schedules> May take (some) soft constraints into account

* Schedule Evaluator> Calculates fitness value for each schedule> Fitness value assigned according to algorithm

* Schedule Optimizer> Constructs a task order list> Can be domain independent (this case) or dependent

Page 11: Chapter 12 Case Studies Part C. Schedule Optimization.

Schedule Representation

•Classic binary coding seldom used now; operators cause infeasible schedules which must be “repaired”

•Direct representation: each element must specify the resource, process, and time span; use special operators to maintain feasibility (can’t use random initialization; maybe use traditional schedule builder to initialize)

•Indirect representation: preference lists, dispatching rules, job-based representation

Page 12: Chapter 12 Case Studies Part C. Schedule Optimization.

Schedule Evaluation

•Minimization of makespan: time from beginning to end

•Weighted function of seven schedule quality criteria:Maximum tardinessAverage tardinessWeighted flow timeWeighted latenessWeighted tardinessWeighted number of tardy jobsWeighted earliness plus weighted tardiness

Page 13: Chapter 12 Case Studies Part C. Schedule Optimization.

One Possible Penalty Approach

Let di be the desired completion time of an event and ci the actual

completion time

Earliness (for one task) can be defined as: )0,max( iii cde

Lateness (for all tasks) can be defined as:

n

iiin dcccC

1

21 ),0(max(),...,(

Issues: Time slices (seconds, minutes, etc.), partial credit for orders, etc.

Page 14: Chapter 12 Case Studies Part C. Schedule Optimization.

Schedule Builder for Facilities Scheduling

* In this case, relatively “simple-minded” – able to build legalschedules with only minor optimization

* Is initialized with base schedule that includes hard constraintsand some high-priority tasks

* Each task is assigned a fitness value for each hour in theweek, then sorted by fitness, then by hour in day/week –the result is a preference vector for each task

Page 15: Chapter 12 Case Studies Part C. Schedule Optimization.

Schedule Builder, Cont’d.

* Tasks are scheduled by looking at “legal” positions

* Depth of search is the maximum number of positions examined

* The first legal time slot with highest fitness value is scheduled

* If no time slots are found within the search depth, the task isnot scheduled

Page 16: Chapter 12 Case Studies Part C. Schedule Optimization.

Schedule Evaluator

* Each task is assigned a priority value - higher values for higherpriorities (values: 40-100)

* Fitness value is initialized to sum of all task priority values

* Tasks scheduled without violating any constraints have priorityvalues added to initial fitness value

* Tasks scheduled that violate soft constraints have 1/2 priorityvalues added (or subtract 10 for each soft constraint violated

* Tasks not scheduled have priority values subtracted

Page 17: Chapter 12 Case Studies Part C. Schedule Optimization.

Data Structures

* Each chromosome is a task list permutation

* Simple task list, however, doesn’t comprise a schedule,because of:* Resource conflicts* Soft constraint violations* Starting times and stopping times not specified

Page 18: Chapter 12 Case Studies Part C. Schedule Optimization.

Crossover and Mutation A variety of crossover and mutation operators are used in

scheduling systems.

In this case:Order-based mutation: Select 2 tasks at random - then

exchange their positionsPosition-based crossover:

Set crossover probability (40% here)Select two parents at randomRandomly select crossover positionsTask positions in one parent are put in same positions

in other parentTasks not imposed from other parent fill in remaining

positions in same order as before crossover

Page 19: Chapter 12 Case Studies Part C. Schedule Optimization.

Crossover Example

Parent 1: A B C D E F G H I JParent 2: E I B D F A J G C H

Positions Selected: * * * * Child 1: A I B C F D E G H J

Child 2: I B C D E F A H J G

Crossover probability: .8 --> .2 (for entire chromosome)Mutation probability: .2 --> .8 (for entire chromosome)

Page 20: Chapter 12 Case Studies Part C. Schedule Optimization.

Summary of Approach

* Simple chromosome representation - task list

* Simple schedule builder - builds “legal” scheduleswith only local optimization

* Fitness based on number and priority of tasks scheduled - penalties for soft constraint violations

* Used order-based mutation and position-based crossover

Page 21: Chapter 12 Case Studies Part C. Schedule Optimization.

Transportation Resource Scheduling Example

Three implementations developed:Genetic algorithmParticle swarm optimizationFuzzy logic

Used Java 2, JDK 1.3

Page 22: Chapter 12 Case Studies Part C. Schedule Optimization.

The Genetic Algorithm Approach

Used preference list representation (just an ordered list of tasks).Each individual is the sequence for delivering all items.

For example, with 50 items, a chromosome might be:

5 24 9 18 34 46 24 41 36 7 …

Fitness is sum of items delivered, penalized by linear earliness and sum-squared latenesses.

A weighting factor <1 often is used for sum-squared latenesses.

Can limit penalty to the priority value.

Page 23: Chapter 12 Case Studies Part C. Schedule Optimization.

Crossover for Transportation Example

Used position-based crossover, as before.Used two-point crossover, as follows:

2 4 0 5 1 3

3 1 2 4 0 5 ^ ^ Point 1 Point2 Exchange the parts between Point1 and

Point2:2 1 2 4 1 3

3 4 0 5 0 5

Replace missing numbers in the same order they were originally:

0 1 2 4 5 3

3 4 0 5 1 2

Page 24: Chapter 12 Case Studies Part C. Schedule Optimization.

Mutation for Transportation Example

Swap mutation was used, as previously.

g

npm

)001.0200.0(001.0

pm is probability of mutation for each item

n is the generation index; g is the total number of generations

Page 25: Chapter 12 Case Studies Part C. Schedule Optimization.

The Particle Swarm Optimization Approach

2,880-cell individuals; two cells for each minute in a 24-hour day.

The first cell for each minute is for heavy trucks, the second for light trucks.

Each number in a cell represents a cargo item.

If a truck is available to load the item in the list at the given minute, it is loaded.

If the item has been delivered, or no resource is available, the cell is ignored.

Page 26: Chapter 12 Case Studies Part C. Schedule Optimization.

The PSO Approach, Continued 5 24 9 18 34 46 24 41 36 7 …… ˆthe first ˆthe second ˆthe third ˆthe fourth ˆthe fifth ˆ……

minute minute minute minute minute

The equation:vid = w * vid + c1 * rand( ) * ( pid - xid) + c2 * Rand( ) * ( pgd - xid )

xid = xid + vid

where:w – the inertia weight. We use a linear function to change the value of w each generation. For the first generation, w is 0.9; it is 0.4 for the last generation. The function is

w = 0.9 – 0.5 * ( current generation ) / ( total generation )

c2 and c1 – two positive constants, each set to 2.0 for this application

Fitness was calculated the same as for the GA version.

Page 27: Chapter 12 Case Studies Part C. Schedule Optimization.

The Fuzzy Logic Approach

This is a simplified version of the system implemented.

It has two input variables:

Loading time (with respect to desired delivery time)

Importance parameter = # of loaded items for an order total # of items for the order

Output variable: Importance of loading and delivery of the item now.

Page 28: Chapter 12 Case Studies Part C. Schedule Optimization.

Examples of Linguistic Input Definitions Time input for heavy truck:

(s = starting time of time window, e = ending time of window)Linguistic Range Lower Limit Upper

LimitVery early s-450 s-300Early s-350 sOn-time s-150 e-150Late e-200 eVery late e-50 e+100

Time input for light truck:(s = starting time of time window, e = ending time of window)Linguistic Range Lower Limit Upper

LimitVery early s-180 s-120Early s-150 sOn-time s-80 e-60Late e-100 eVery late e-20 e+30

Page 29: Chapter 12 Case Studies Part C. Schedule Optimization.

Trapezoidal Membership Function Example

Page 30: Chapter 12 Case Studies Part C. Schedule Optimization.

Linguistic Output Variable Definition

(Importance of loading and delivery of each item.)

Linguistic Range Lower Limit Upper Limit

Very unimportant 0 0.3Unimportant 0.25 0.55Fairly important 0.5

0.75Important 0.7 0.9Very important 0.85

1.0

Page 31: Chapter 12 Case Studies Part C. Schedule Optimization.

Define Fuzzy Rules

timeurgency

veryearly

early on-time late verylate

Very minor Very unimportant

Unimportant Unimportant Very unimportant

Very unimportant

Minor Very unimportant

Unimportant Fairlyimportant

Unimportant Very unimportant

Medium Unimportant Fairlyimportant

Important Fairlyimportant

Very unimportant

Large Fairlyimportant

Important Very important

Important Unimportant

Very large Fairlyimportant

Important Very important

Important unimportant

Page 32: Chapter 12 Case Studies Part C. Schedule Optimization.

The Fuzzy Process Initialize the order list by requested time of delivery for each item. Implement the fuzzy logic by calculating the priority parameter for each item not yet delivered each minute of time.

Determine items with the highest priority for the heavy and light trucks using the fuzzy rules defined above. Items thus determined are designated to be loaded at starting at that minute. The times included in the schedule include the times needed to load and unload items: one minute for each carton, and three minutes for each pallet.

Use centroid defuzzification as follows:

)(

)(Output

ia

iai

x

xx

Page 33: Chapter 12 Case Studies Part C. Schedule Optimization.

Other Scheduling Systems

* Job Shop Scheduling is another major scheduling application* Input: customer order (product and quantity)* Output: products/parts* Process: sequences of machine operations* Requirements: time and resources

* Objectives* Ship orders on time* Minimize unused resources* Minimize inventory

* The objectives conflict

Page 34: Chapter 12 Case Studies Part C. Schedule Optimization.

Other Scheduling Systems, Cont’d.

* Scheduler selects which process sequence to use for eachproduct

* Job shop scheduling is significantly different from travelingsalesman problem, for which information is in connectionsand many permutations of optimum solution exist

* “...the chromosome representation used should be much closer to the scheduling problem.” – Michalewicz

* Schedule may better be done by machine than by time slot

Page 35: Chapter 12 Case Studies Part C. Schedule Optimization.

Other Scheduling Systems, Cont’d.

* Each machine can have a “preference list” of parts or productsExample: {part_3, part_6, part_1, ..., wait}

* Can use strategy that first “legal” choice is made; if noneavailable, go into waiting state

* More direct representations of schedule are used aschromosomes

* Special operators must then be developed for the problem-specific representationExamples:

Scramble mutation: scrambles preference listExchange crossover: exchanges preference lists