Efficient scheduling jobs with declining profits on multiple machines - algorithm

Problem: Consider the scheduling problem of n jobs on M machines where each job i have a processing time pi and gives a profit gi(t) if completed by time t. All the jobs are released at time 0. All gi(t) are non-increasing functions. For simplicity, we can assume that the machines are not preemptive.
For M=1 and linearly decreasing profit functions. this problem can be solved in O(n) using the greedy algorithm. But for general functions it is NP-complete.
I am interested in the general case. Please give me any link of papers or resource materials for the problem. I searched on the internet but didn't find anything interesting for M>1, though there is previous work on approximating the bounds for M=1.
Please note that I am not expecting you to solve this but just need previous work on the similar problems, if any. And if you have any ideas which can help please feel free to share.
I want know what bounds are know for this problem with m machines and n jobs with same release dates and general non-increasing profit functions. I found a paper towards that direction
http://arxiv.org/pdf/1008.4889v1.pdf
They gave an O(1) approximation when all jobs have identical release times. I want to find similar kind literature for the problem and what ideas they used for solving the problem.

You can start with a "greedy solution" by using a dispatch rule that e.g. minimizes
gi(t0+pi)/pi
on the first empty machine (i runs over all not yet scheduled jobs, t0 is the time, where the first machine is empty).
Then this solution can be improved using Meta-Heuristics like Simulated Annealing. A solution can be represented as a tuple of job sequences (one job sequence for each machine). A crucial point is, what "moves" are allowed to change a solution. Maybe for this problem one can find already good solutions with the two basic moves:
Take one job from one machine and find a new place to insert it.
Exchange two jobs in the machines' job sequences.

Related

How to solve optimization problem involving fixed order of sites to be visited at given time windows

I hope someone can give a suggestion, that is only that I am asking for.
So there is an array of sites that should be visited in a given order (a run). Each site has to be visited in a given time window constraint and job there is to be done in a particular duration. There is also a traveling time to that site from a previous site given. This is a rough illustration of one example run:
The final goal is to minimize the overall time needed to visit all sites and finish all jobs.
First question: is there anything, any algorithm that solves closely similar to this problem?
Second: In your opinion, what is the best approach for solving this?

Prepare a schedule so that all courses are taught in the least time

I encountered one interview question:
There are some professors, some courses, and some students.
Each professor can teach only a single course.
Each course has a fixed duration(Eg. 10 weeks).
For each professor, you are given time availability schedule(assume week wise).
Each student has a list of courses he wants to learn.
There can be only 1:1 classes, i.e., 1 professor can teach only a single student.
A student can attend only one course at a time.
A professor has to finish teaching a course in a one go.
Your aim is to prepare a schedule so that all courses are taught in the least time.
My Approach: I mentioned that this will be solved via graph theory.Like make a directed edge from teacher to course or teacher to student.But I was not able to solve it completely .
Is my approach correct or is it DP problem?
Pseudocode or Algorithm suggestions?
The problem you were asked is a schedulling problem, which is a dynamic programming problem. In particular, your problem is what is usally called FJm|brkdwn,pj=10|Cmax, wich can be traduced as follow:
There are m machines (the professors) that can process a part of a job (here, a job is the full teaching of a student) independently and in whatever order. Some machines may process the same part of a job (the same course)
machines are not continuously available
the duration of a part of a job (a course) is 10 weeks
you want to minimize the time completion of all jobs
There exist solvers that are well optimized for schedulling problems, but I am not sure if to model your problem as a scheduling problem and to process it through a shedulling problem solver is what was intended by your job interviewer.
This is similar to the m-coloring problem. Except here we are asked to return the minimum m. Unfortunately, it's an NP-hard problem.
For the given problem, consider a course as a vertex and edge b/w 2 vertexes if a common student exists or professor is the same.
Now first, find the upper bound of m (minimum colors required) using Welsh–Powell Algorithm and then we can do a binary search to find which is the smallest value of m for which we are able to color all the vertex (with no 2 adjacent vertexes with the same color) using Graph Coloring

NP-Hardness proof for constrained scheduling with staircase cost

I am working on a problem that appears like a variant of the assignment problem. There are tasks that need to be assigned to servers. The sum of costs over servers needs to be minimized. The following conditions hold:
Each task has a unit size.
A task may not be divided among more than one servers. A task must be handled by exactly one server.
A server has a limit on the maximum number of tasks that may be assigned to it.
The cost function for task assignment is a staircase function. A server incurs a minimum cost 'a'. For each task handled by the server, the cost increases by 1. If the number of tasks assigned to a particular server exceeds half of it's capacity, there is a jump in that server's cost equal to a positive number 'd'.
Tasks have preferences, i.e., a given task may be assigned to one of a few of the servers.
I have a feeling that this is an NP-Hard problem, but I can't seem to find an NP-Complete problem to map to it. I've tried Bin Packing, Assignment problem, Multiple Knapsacks, bipartite graph matching but none of these problems have all the key characteristics of my problem. Can you please suggest some problem that maps to it?
Thanks and best regards
Saqib
Have you tried reducing the set partitioning problem to yours?
The SET-PART (stands for "set partitioning") decision problem asks whether there exists a partition of a given set S of numbers into two sets S1 and S2, so that the sum of the elements in S1 equals the sum of elements in S2. This problem is known to be NP-complete.
Your problem seems related to the m-PROCESSOR decision problem. Given a nonempty set A of n>0 tasks {a1,a2,...,an} with processing times t1,t2,...,tn, the m-PROCESSOR problem asks if you can schedule the tasks among m equal processors so that all tasks finish in at most k>0 time steps. (Processing times are (positive) natural numbers.)
The reduction of SET-PART to m-PROCESSOR is very easy: first show that the special case, with m=2, is NP-complete; then use this to show that m-PROCESSOR is NP-complete for all m>=2. (A reduction in Slovene.)
Hope this helps.
EDIT 1: Oops, this m-PROCESSOR thingy seems very similar to the assignment problem.

algorithm similar to 'assignment task'

Here is the assignment problem http://en.wikipedia.org/wiki/Generalized_assignment_problem
I have a similar task, but can't find the algorithm.
We have m tasks, n laborers, m>n. When task is done, the laborer takes the next one (if there is free one). If task is taken by some laborer, no one else can take it. Each laborer has his own speed: V1..Vn, each task has its own 'volume' - W1..Wm. So, i need to distribute tasks between laborers with the goal of minimization of time doing all tasks.
Please help me to find an algorithm or how this problem is named.)
This problem is scheduling jobs on parallel, uniformly related machines so as to minimize the makespan. There's a polynomial-time approximation scheme due to Hochbaum and Shmoys (Using dual approximation algorithms for scheduling problems: Theoretical and practical results, 1988). btilly is right that the bin-packing problem is closely related; the analyses of both Hochbaum--Shmoys and the previous best approximation MULTIFIT are based on techniques pioneered for bin packing.
This looks like a likely np-complete variation of the http://en.wikipedia.org/wiki/Bin_packing_problem. I would therefore not worry about an exact algorithm.
Assuming that the tasks are independent, my first try would be a greedy heuristic. Given an estimate of finishing time, assign to each worker at all points the longest task that they can finish before that finishing time. Now do a binary search to find the shortest finishing time that you can get away with. Your initial upper time is the time for the fastest worker to do everything. Your initial lower time is the time for all of the workers to complete that much work if all are working at the same time.
This is clearly not always going to be perfectly optimal. But it should work reasonably well.

Algorithm for Trading Resources

I'm trying to find the best algorithmic solution to the following problem. It's a real-world problem, but I'm going to present it in an abstract manner.
There is a community of 1000 people. Each user is provided with a set number of tickets. There are four types of tickets (each one corresponds to a different event). However, some people are willing to make trades (for example, I want one A-ticket and am willing to give up two B-tickets). Moreover, some people have extra tickets that they are willing to give away for nothing (for example, I'll give away two C-tickets to whoever wants them). Assuming that I know what each person is willing to give away / trade, how do I satisfy the most number of people?
I tried Googling, but I don't know how to word this problem to avoid getting results related to algorithmic trading of financial instruments.
Thanks.
Given that it has multiple dimensions, it is likely an NP-complete problem. It has parallels to a multi-dimensional knapsack problem.
Therefore, I recommend trying a backtracking approach.
Start with everybody involved in the trade.
Sort the people who cause the most deficit descending (here you can weight the deficit caused by each ticket type by the shortfall in each ticket).
Then in a backtracking manner, kick the person causing the next highest deficit person out of the trade.
Repeat until you either have no more deficit in any ticket (record as possible answer), or you have kicked everybody out.
When that happens, backtrack 1 step and continue (if you already tried kicking the highest deficit, kick the next highest deficit causing person).
Repeat until end or you run out of time. Get the optimal answer out of the possible answers you found.
If the problem is too hard, it will probably run out of time. Otherwise, this algorithm should give you a reasonable answer (perhaps near to optimal).
How well this method works depends on how generous/greedy the people are, how many people there are, and how fast your computer is.
Look for a bipartite minimum weigth matching problem. The idea is to find the shortest distance from i to j using vertices 1 .. k only.

Resources