Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Job priority #246

Closed
jcoupey opened this issue Jun 27, 2019 · 4 comments · Fixed by #247
Closed

Job priority #246

jcoupey opened this issue Jun 27, 2019 · 4 comments · Fixed by #247

Comments

@jcoupey
Copy link
Collaborator

jcoupey commented Jun 27, 2019

The current optimization objective has two levels:

  1. Minimize the number of unassigned jobs
  2. Minimize total travel time

So whenever the number of unassigned jobs is the same for two different solutions, we'll consider the one that has the lowest total travel time.

As a result, we'll tend to return as unassigned the jobs that are "more expensive" (e.g. furthest or with higher amount). This is clearly not ideal in settings where jobs can have different levels of priority. Think "this job is due today", or "it would be nice if this jobs fits in but no big deal if not".

What we could do is add a new priority key for jobs in input, and then change the first objective above to minimize the sum of priority scores over unassigned jobs. The current behaviour would match the situation where all priority values are equal, which we could also use as default.

@jcoupey jcoupey added this to the v1.5.0 milestone Jun 27, 2019
@jcoupey jcoupey self-assigned this Jun 27, 2019
@MingyiZhang
Copy link

Is it possible to force the algorithm to assign all jobs?

@jcoupey
Copy link
Collaborator Author

jcoupey commented Jun 28, 2019

Is it possible to force the algorithm to assign all jobs?

No, not if it means breaking some of the constraints you described in input. If you are willing to break some constraints to include more jobs, it might be an indication that your constraints are too tight in the first place.

This ticket is about providing a way to influence what jobs will be unassigned in a situation where not all jobs can be done.

@jcoupey jcoupey mentioned this issue Jun 28, 2019
7 tasks
@jcoupey
Copy link
Collaborator Author

jcoupey commented Jul 3, 2019

The sketch for the API addition is simply to add an optional priority key in entry for jobs (defaulting to 1). Giving a though to possible values, I came to the conclusion that we should bind them in a predefined range for convenience, and also to avoid huge behaviour inconsistencies due to very different value scales being defined by different users. I'm thinking allowing priority values in the [1, 100] range because:

  • I don't see the point in using higher values
  • using a smaller range like [1, 5] or even [1, 10] can lead to unwanted situations where a mandatory job with priority N could be included, but still gets discarded because we come across another solution that does not assign it but with N + 1 more jobs with the lowest priority.

@jcoupey
Copy link
Collaborator Author

jcoupey commented Jul 4, 2019

On second though, the problem of a job with priority 10 getting unassigned because we favor 11 priority-1 jobs instead can be leveraged by allowing 0-priority jobs. Then those jobs will have no impact on priority sum but it does not mean we won't consider including them at all. Indeed the multi-level objective will tend to favour solutions with less unassigned jobs (at equal priority sum).

So I'm thinking of defining valid priority values for jobs as integers in the [0, 10] range, the default value being 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants