I have gone through a list of scheduling algorithms and their implementation, however couldn't find any reference to implement an algorithm that solves the following problem.
Given an array of processes having n process, the i'th process being represented by:
Arrival[i] representing its arrival time,
Depart[i] representing the time when a process will be terminated (processed or unprocessed doesn't matter) and
Time[i] representing the time required to serve the process, and
Preferred[i] representing a Boolean value (true if that process is preferred, false otherwise)
We need to schedule the processes to maximize processing of preferred processes. A preferred process will have Preferred[i] as true.
The constraint being only a single process can be served at a time, and if a process departs before its completion its said to be unprocessed.
In case of a tie following rules apply:
- Serve maximum number of processes (preferred and non- preferred combined).
- Minimize the Processing time.
Any leads would be appreciated.