2

I'm trying to combine a Scheduling and an Assignment Problem in Python.

More precisely, I'm trying to assign deliveries to trucks and create a schedule (in the best way in form of date and time) for these deliveries.

Right now, I modeled the problem in a graph, where the nodes represent the different locations and the directed edges between the nodes (locations) represent the deliveries. My graph is a multi graph, so the deliveries (e.g. from A to B) may occur more frequently. As my input, I know all deliveries that need to be done and the available trucks to fulfill the request. There are also some additional conditions to this problem. First, the trucks have to go into maintenance after a certain amount of time (dependent on the kms. driven) and I want to have as less trucks as possible in maintenance at the same time. Means, the time when the maintenance is due can be shifted to an earlier time. Also there is a specified unloading time predefined, which is not allowed to be less than this predefined time.

My idea so far is, that I model the maintenance also as a "delivery" with the only difference, that this delivery starts and ends at the same point (location, where maintenance is possible). Each delivery or maintenance has a predefined length. My idea, each delivery or maintenance is an edge with attributes, which are: length (duration for this "task"), start time (only assigned for maintenance before the optimization, should be filled out for all tasks after the optimization) and fulfilled by (defines, which truck fulfills the delivery/ maintenance, for maintenance it is also predefined before the optimization).

I'm doing all my graph related modelling with networks (Hope this is a good choice).

To the optimization problem. The goal is to assign the deliveries to the trucks in as little time as possible with as less trucks as possible in maintenance at the same time.

So the important question I have is, how can I implement this in Python? Does anybody of you have a great idea how I can model the time for my scheduling so that my optimization gives me my wanted output? And what packages/ optimization tools are the best for this problem?

I hope everything is understandable, if not please ask.

Dragon
  • 1,194
  • 17
  • 24
Cocolino
  • 21
  • 2

1 Answers1

0

I had been searching for the answer for the same question. However, I have to choose a set of best candidates out of a great number of possible ones to create a schedule. Best candidates must satisfy to the number of constraints and must maximize the objective function. I found a good tool from Google with examples of solving both problems separately. But I haven't understand how to combine both approaches yet.

Assignment : https://developers.google.com/optimization/assignment/overview

Scheduling: https://developers.google.com/optimization/scheduling

Dharman
  • 30,962
  • 25
  • 85
  • 135
Elya Fadeeva
  • 148
  • 12