Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland...

37
Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013

Transcript of Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland...

Page 1: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Workload balancing

Mikko Malinen and Matti Mononen

School of Computing

University of Eastern Finland

13.5.2013

Page 2: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Aim

To minimize traveling time of home care workers with modest constraint violations.

Page 3: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Input

Workers on duty that day

- Capabilities for the tasks (bathing, blood pressure, etc.)

- Transportation (walk, bicycle, or car)- Workshift

Patients in need of caretaking that day

- Requirement of a task (bathing, blood pressure, etc.)

- Time window- Location

Page 4: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

OutputPatients of that day assigned to workers

worker 1

worker 2

worker 3

= patient location

Page 5: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Example of worker data

Capabilities: 011000111100000011101

workshift start time: 07:00

workshift end time: 12:00

work load: 100

allergies: 0000

student: 0

transport method: 2

driving_licence: 1

gender: 1

Page 6: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Example of visit datarequirements: 000000000000000001000allergies: 0000start time: 14:01end time: 16:00duration: 30coworker required: 0same gender: 0gender: 0student: 0bath: 0cleaning: 0location: latitude: 60.986986184940235 longitude: 25.685073536380834electric_lock: 1force preferred worker: 0preferred_worker: 15954638secondary_preferred: id: 3715345 id: 36541294preferred_team_id: 3451717

Page 7: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Outline of the algorithm

1) Find a minimum violation solution

Input: constraint violation costs constraints

Output: assignment of tasks to workers

2) Decrease path time by local search, allowing some more constraint violations

Input: constraint violation costs, constraints, previous solution, task locations

Output: assignment of tasks to workers

Page 8: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Setting constraint violation cost

Type Example cost

Requirements-capabilities 1000 = important

Work shift 1 = less important

Allergies 1

Student 1

Gender 1

Force preferred worker 2

Cost between a worker and a patient

Page 9: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

(Example by Wikipedia)

Hungarian algorithm for pairing

Clean bathroom

Sweep floors

Wash windows

Jim $1 $2 $3

Steve $3 $3 $3

Alan $3 $3 $2

Page 10: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Getting minimum violation solution

Patients

Worker 1 Worker 2 Worker 3

000022

2

1000

1000100

0

1000

111

X3 X6 X9

by Hungarian algorithm, which makes a minimum-weight match (pairing) between the upper and lower nodes

2

Injection needed

No injection capability

-by pairing

Page 11: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

A feasible, minimum violation solution

feasible = allowed

Page 12: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Path = route traveled by workersPath cost = “time” to travel, we

estimate this

clustersamein

and

2),( cost Path

j

iXX

ji XXtime

Path cost

Page 13: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Local search to minimize the cost function

Cost function = total violation costs + a×(path cost)

User sets parameter a.Local search = making allowed swaps between points (patients) in different clusters (workers)

Page 14: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

The optimization may be run on web

http://cs.uef.fi/o-mopsi/points/

Page 15: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Path cost

Distance- Currently, we consider Euclidean distances- Roads are not taken into account

Traveling time

- Currently, we use fixed speeds for different modes of transport

- Type of road is not taken into account

Page 16: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Distance: Euclidean vs. Street

Euclidean distance

1 km 100 m

Street routing2 km 700 m

Page 17: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Travel time estimation

Euclidean:60 km/h 1 min

Routing:60 km/h 2.7 minActual 8.0 min

Page 18: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Options for routing

3rd party API- well-documented interface- no access to algorithms & data

Personal solution- road network in database- algorithms for handling and routing

Page 19: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

API vs. Personal solutionProperty API Personal

Setting-up Very easy Pretty difficult

Ease of use Easy Easy (or difficult)

Speed Fast Depends on hardware

Reliability Very high Can be unreliable

Dependency Yes, from the 3rd party No

Price of setting-up None Some? (working hours)

Price of usage High* None

Updating the data Automatic Needs to be taken care of

Quality of the data High Varies

Customizability None Excellent

*commercial usage

Page 20: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

API services

Geocoding

- Address ↔ coordinates

Routing (Point A → Point B)

- Distance- Traveling time- Turn-By-Turn directions

Map tiles

- Visual representation

Page 21: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Geo-codingSirkkalantie 2JoensuuFinland

62.60215829.774526

62.59540329.742082

Länsikatu 2JoensuuFinland

Page 22: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Routing

From: Länsikatu 2

JoensuuFinland

To: Sirkkalantie 2JoensuuFinland

Totals:2 km 700 m in 8 min

Turn-by-turn:1. Länsikatu toward Louhelankatu 240 m2. Take the 2nd right onto Papinkatu 800 m3. Continue onto Rantakatu 800 m4. Turn right onto Siltakatu 500 m5. Turn left onto Itäranta 240 m6. Turn left onto Sirkkalantie 60 m

Page 23: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Map tiles

62.59971729.754474

62.59585829.762768

Page 24: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

GoogleMapsData:Proprietary (different sources)

Free version:Max queries: 25k / dayCommercial usage: NO

Paid version:Max queries: 100k / dayPrice: $10k+ / year

Page 25: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

MapQuest 1Data:OpenStreetMap

Free version:Max queries: unlimitedCommercial usage: OK

Paid version:Max queries: -Price: -

Page 26: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

MapQuest 2Data:Proprietary (different sources)

Free version:Max queries: 5k / dayCommercial usage: NO

Paid version:Max queries: unlimitedPrice: $2.5k+ / year

Page 27: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Nokia MapsData:Proprietary (different sources)

Free version:Max queries: 2.5k / dayCommercial usage: NO

Paid version:Max queries: 100k / dayPrice: $18k / year

Page 28: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Bing MapsData:Proprietary (different sources)

Free version:Max queries: 125k / yearCommercial usage: NO

Paid version:Max queries: ???Price: ???

Page 29: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

CloudMadeData:OpenStreetMap

Free version:Max queries: 25k / monthCommercial usage: OK?

Paid version:Max queries: unlimitedPrice: $400 / 10M queries

Page 30: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

3rd party APIs

FREE PAIDData Max.

queriesCommercial usage

Max. queries

Price

MapQuest 1 OSM Unlimited

OK - -

Google Maps

proprietary

25k / day NOT 100k / day

$10k+ / year

MapQuest 2 proprietary

5k / day NOT unlimited $2.5k+ / year

Nokia Maps proprietary

2.5k / day

NOT 100k / day

$18k / year

CloudMade OSM 25k / month

OK? unlimited $400 / 10M

queriesBing Maps proprietar

y125k / year

NOT ? ?

Yahoo! Maps1

– – – – –1merging with Nokia Maps

Page 31: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

OpenStreetMap

Global dataset

Wiki-type, getting better all the time

Varying quality

- as good as GoogleMaps in larger cities (Helsinki)

- only main roads in country side

Well-known, relatively well documented

Can be used for routing

Lots of mapping components implemented

Page 32: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

OpenStreetMap

Helsinki

Juankoski

Page 33: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

National Land Survey of Finland

Local dataset (Finland)

Data freely available and can be used without restrictions

High-quality, consistent material

Documentation does not exist

Not good for routing

Page 34: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

National Land Survey of Finland

Helsinki

Juankoski

Juankoski

Page 35: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Digiroad

Local dataset (Finland)

Uses NLS material but enriches it

- turn restrictions

- speed limits

- road types

Excellent for routing

Price: approx. 200 €

Page 36: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Digiroad material

Page 37: Workload balancing Mikko Malinen and Matti Mononen School of Computing University of Eastern Finland 13.5.2013.

Navteq & Tele Atlas

Global datasets

High quality, commercial products

Used by navigator manufacturers (TomTom, Garmin)

Licensing prices not known