https://github.com/bapjiws/job-scheduler-greedy-algorithm
Script with command-line arguments
https://github.com/bapjiws/job-scheduler-greedy-algorithm
Last synced: 2 months ago
JSON representation
Script with command-line arguments
- Host: GitHub
- URL: https://github.com/bapjiws/job-scheduler-greedy-algorithm
- Owner: bapjiws
- Created: 2015-04-01T04:37:44.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-05-12T09:11:55.000Z (about 10 years ago)
- Last Synced: 2025-01-28T16:44:18.056Z (4 months ago)
- Language: Python
- Homepage:
- Size: 156 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is the implementation of the greedy algorithm that optimally schedules jobs in decreasing order of the ratio (weight/length) in order to minimize the weighted sum of completion times. The program reports the sum of weighted completion times and optionally prints the sequence of jobs with corresponding completion times to the standard output. (If two jobs have equal ratio (weight/length), the job with higher weight is scheduled first.)
The input file should describe a set of jobs with positive and integral weights and lengths and have the following format:[number_of_jobs]
[job_1_weight] [job_1_length]
[job_2_weight] [job_2_length]
...
For example, the third line of the file is "74 59", indicating that the second job has weight 74 and length 59.