industrial project (236504)

25
Industrial Project (236504) Transportation task planning algorithms ClickSoftware Students: Noam Lavie, Ori Shalev Supervisors: Israel Beniaminy, Simon Arazi

Upload: elmer

Post on 12-Jan-2016

32 views

Category:

Documents


0 download

DESCRIPTION

Industrial Project (236504). Transportation task planning algorithms ClickSoftware. Students: Noam Lavie, Ori Shalev Supervisors: Israel Beniaminy, Simon Arazi. Introduction. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Industrial Project (236504)

Industrial Project (236504)Transportation task

planningalgorithms

ClickSoftware

Students: Noam Lavie, Ori ShalevSupervisors: Israel Beniaminy, Simon Arazi

Page 2: Industrial Project (236504)

Introduction

• The operation of a modern transportation systems is extremely complex and it requires coordination between many factors:

– Regulator

– Time table

– Facilities: stations, platforms, ticketing self service kiosks, vending machines

– Network: railways, electricity supply, signaling, communication

– Vehicles

– People: drivers, call center, ticketing, passenger agents, maintenance, control room

• In this project we are focusing on train drivers and their working arrangement.

• There are many possible working arrangements, but some are better then others.

• The optimal arrangement covers the required service level (time table) with the minimal cost (headcount)

Page 3: Industrial Project (236504)

Our Objective

• To develop and test working arrangement algorithms for train drivers.

• The algorithm receives the train schedule (time table), and output a working arrangement for the drivers.

• The algorithm should find a valid working arrangement with the minimal headcount.

Page 4: Industrial Project (236504)

Methodology

• There were few methods that we could apply in our project, we took the first few weeks to study the subject a bit: we read material on the internet, consulted with experts from different fields and thought of our on ideas.

• We built Infrastructures that would help us to solve the problem. • We thought and implemented few greedy algorithms. The purposes were

having a reference to compare our future results against and have a first feeling of creating a new algorithm and working with the Infrastructures.

• One of the greedy algorithms was exceptionally better than the others, we decided to keep working with it. Also, it gave us ideas for new , not greedy, algorithms.

• We built s graphical visualization of the results – that helps us understand the solutions and their results.

• We created the “framework“ that helped us run (multi-threaded), save and reload different algorithms results.

• We thought and implemented 5 different algorithms that were based on the first “greedy” algorithm and tried to improve it.

Page 5: Industrial Project (236504)

Infrastructures

• Input’s parser• Building a graph from the input• The frame-work• Graphical visualization• Apsp• Real data base of cities: coordinates and

distances between them.

Page 6: Industrial Project (236504)

Graphical solution visualization

New features to v3:

• Smooth transition• Mouse dragging• floating message box.• Improved zooming

capabilities

Page 7: Industrial Project (236504)

Multi-core framework

Goals:

•Take advantage of the fact that each random run has no dependence at any other data.

•Boost the throughput of the algorithm runs by x8 relative to single threaded serial running.

•Support for “restore from seed” rerun of interesting results.

Page 8: Industrial Project (236504)
Page 9: Industrial Project (236504)

Building a graph from the input

Every leg is displayed in the graph as 4 nodes:

The leg’s from city

And the time

The leg’s to city

And the time

Leg’s IDStart time

Leg’s IDend time

Page 10: Industrial Project (236504)

Building a graph from the input

Page 11: Industrial Project (236504)

Algorithm’s evolution:

• Our first algorithm was the “greedy algorithm”

• For every leg in the leg list:– If there is a driver who can take the leg:

• Give the leg to the most veteran driver• Apply the possible legs that the driver can take (remove the

driver from all the legs he can’t take now)

– Else (there isn’t a driver who can drive the leg)• “Create” a new driver and give him the leg• Apply all the possible legs that the driver can take (add the

driver to all the future legs he can take)

Page 12: Industrial Project (236504)

Algorithm’s evolution:

• General point about the algorithms:– All legs are sorted by starting time– After the algorithms finish, we pick the best solution

by:• First: the solution with the minimal drivers number• Second: the solution where drivers finish their work day in

minimal distance from their starting day point

Page 13: Industrial Project (236504)

Algo No. 1: “Random Break Algo”

• The main goal: greediness reduction, make the algo less deterministic

• The idea: don’t give the leg to the most veteran driver automatically. Give the leg randomly to one of the possible drivers. Give a veteran driver a higher probability to be chosen.

• The algo:

• For every leg in the leg list:– If there is a driver who can take the leg:

• Sort all possible drivers by their veteran value• Go over the sorted list (from the most veteran driver to the newest), for every

driver in the list:– By probability of P, Pick the driver to take the leg (and finish going over the list)

– Else (there isn’t a driver who can drive the leg)• “create” a new driver and give him the leg• Apply all the possible legs that the driver can take (add the driver to all the

future legs he can take)

Page 14: Industrial Project (236504)

Algo No. 2: “Random New Driver Algo”

• The main goal: greediness reduction, improve the drivers selection , add a “new driver” opportunity.

• The idea: choose a driver from the driver list more “wisely”, beside the opportunity to give the leg to an exist driver: create a chance of giving the leg to a new driver.

• Improvements:– Choose driver: every driver has a probability to take the leg related to

the total breaks he took so far. – New_driver_probabilty: we want to give a chance to a new driver to get

the current leg for some probability. the probability value will be affected by a heuristic function that affected by the next parameters:

• drivers_num: the more drivers who can take the leg, the less probability to give the leg to a new driver

• reachable_legs: the more reachable legs from the given leg (in the near future), the probability to give the leg to a new driver is higher.

• day_time_prob: as the time becomes late there is less probability to “create” a new driver.

Page 15: Industrial Project (236504)

Algo No. 2: “Random New Driver Algo”

• The algo:

• For every leg in the leg list:– If there is a driver who can take the leg:

• For some probability depends on a heuristic function – give the leg to a new driver.

• Or: • Give the leg to some driver from the list, give higher probability to

drivers who already took enough breaks.

– Else (there isn’t a driver who can drive the leg)• “Create” a new driver and give him the leg• Apply all the possible legs that the driver can take (add the driver to

all the future legs he can take)

Page 16: Industrial Project (236504)

Algo No. 3: “repair algo"

• The main goal: take a greedy solution and improve it. • The idea: take a given solution, try to solve a small part

of it again using the “Random Break Algo” – hopefully that when we combine the new sub solution to the old one, we will get a better solution.

• features:– Choose problematic driver: the sub solution that we want to

improve is supposed to have a “problematic” driver that we can erase, this feature chooses randomly a “problematic” driver. The shorter the driver’s day plane is the more likely he would be considered problematic and will get higher probability to be chosen.

Page 17: Industrial Project (236504)

Algo num 3: “repair algo"

The algo:• Take a greedy solution• Chose a “problematic” driver• Take a random radius of time before and after the driver.• Solve again the sub problem for a day that starts and

ends in the limited day time within the radius time.• Combine the new sub solution to the old one (replace

the shifts of the old solution in the radius time to the shifts of the new solution)

Page 18: Industrial Project (236504)

/ /١٤٤٤ ١٠ ١ Page 18

Preface:

•Flow network

the Ford-Fulkerson maximum-flow method using residual networks.

maximum bipartite matching using a reduction to max-flow problem. minimal path covering ( on DAG ).

Algo No.4: “Dual greedy algo & matching”

Page 19: Industrial Project (236504)

/ /١٤٤٤ ١٠ ١ Page 19

The original greedy algorithm seems to have few drivers left mostly at the end with very little legs to drive.

What if we could just reverse the direction of the greedy leg covering and some how merge half greedy and half reversed greedy solution together in a “smart” manner?

Reversed greedy algo is the exact opposite of the greedy algo. Is sorted the legs by ending time, and starts it’s covering routine from end to start.

Let by all of the legs that need to be covered.

With probability cover one leg using the regular greedy algo, otherwise cover one leg with the reversed greedy algo.

By the end of the run we will find ourselves with half covered legs by the “front” greedy cover algo, and another half that was covered by the reversed greedy algo.

1,...., kL l l

switchP

Algo No.4: “Dual greedy algo”

Page 20: Industrial Project (236504)

/ /١٤٤٤ ١٠ ١ Page 20

Now we are left with the problem of merging front and back legs into one driver.

In order to do that in the best possible way wee will build bipartite graph as follow:

where

Now all is left is to run the maximum bipartite matching algo in order to find the smallest number of driver to the entire problem.

Results:Unfortunately the results weren’t better then the original greedy leg cover algo.

,G L R E

| is a driver from the front coverd algo

| is a driver from the back coverd algo

{ , | }

L v v

R v v

E u v we can merge driver u with driver v

Algo No.4: “Dual greedy algo”

Page 21: Industrial Project (236504)

/ /١٤٤٤ ١٠ ١ Page 21

Algo No.4: “Dual greedy algo”

Page 22: Industrial Project (236504)

Algo No.5: Break & merge algo

Ok, by now we know that merging 2 greedy solution doesn’t help us much.

For the following algo we will need to review the minimal path covering problem.

Let be a DAG. Path cover of V’s vertices is a group of paths Such that of

There is an algorithm for finding minimum path covering using the abovebipartite matching algo. We will just use it as a black box algo in order to calculate The minimum path covering of our graph.

The algoLet’s take a solution of the greedy algo and break up each driver path into smaller pieces. How small? If there is a break of more then 20 minutes then the path will Be break into 2 separate paths.

,G V E

i ji j p p

Page 23: Industrial Project (236504)

Now we will build a new graph.

For each sub path that we get from breaking the long path we will create a vertex in the graph.

Let say driver 1 drove legs 1,2,3,4 and we broke that into legs 1,2 and 3,4 than the path 1,2 will made one vertex , and path 3,4 will made the other one.

The edges:

Now we will run the minimal path covering algo, this will give us the minimal drivers needed to drive all of the leg all together.

So is it an optimal solution? No. the problem is that we don’t know anything about the rest of the path will matching 2 vertex .

For example:

Leg 1 from 8:00 to 12:00

Leg 2 from 12:00 to14:00

Leg 3 from 14:00 to 19:00

It is legal to connect 1 to 2 and 2 to 3 bit the algo will do it best to find the minimal cover and therefore will match 1 to 2 and 2 to 3 and that path is illegal. Trying to re-break the path into smaller legal paths will end up with solution no better than the original greedy algo.

Algo No.5: Break & merge algo

, | legally ,E u v one driver can drive u and than v without breaking any of the constrains

Page 24: Industrial Project (236504)

Achivments

• Infrastructures: a wide set of tools that hopefully use for farther work on the project.– Solution visualization, generic multi-threaded “frame-

work”, implements of flow’s algorithms.

• Five different algorithms.• A “greedy” algorithm that returns good solutions

in minimal time.

Page 25: Industrial Project (236504)

Conclusions

• Unfortunately non of our developed algorithms gave us a significant improvement over the firs “greedy” algorithm. Reasons for that may be:– Maybe the first “greedy” algorithm is not so bad as we think,

maybe there is no such difference between the “greedy” results and the best solution results.

– Maybe the algorithms can give better solutions on different problems that we didn’t check.

– Maybe the main ideas of the algorithms are good, but we made some wrong choices in some of the sub problems along the way.

– Maybe the algorithms are just not good enough. • The first “greedy” algorithm can give a reasonable

solution in minimum time, therefore it may be used in cases when we need fast answers.