https://github.com/sleekpanther/interval-scheduling
Greedy Algorithm to find the maximum number of mutually compatible jobs
https://github.com/sleekpanther/interval-scheduling
algorithm algorithm-design algorithms compatible greed greedy greedy-algorithm greedy-algorithms interval interval-scheduling jobs noah noah-patullo noahpatullo optimal pattullo pattulo patullo patulo schedule
Last synced: 3 months ago
JSON representation
Greedy Algorithm to find the maximum number of mutually compatible jobs
- Host: GitHub
- URL: https://github.com/sleekpanther/interval-scheduling
- Owner: SleekPanther
- Created: 2017-08-05T14:45:59.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-07T11:48:26.000Z (almost 8 years ago)
- Last Synced: 2025-01-15T13:08:07.488Z (5 months ago)
- Topics: algorithm, algorithm-design, algorithms, compatible, greed, greedy, greedy-algorithm, greedy-algorithms, interval, interval-scheduling, jobs, noah, noah-patullo, noahpatullo, optimal, pattullo, pattulo, patullo, patulo, schedule
- Language: Java
- Homepage:
- Size: 657 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Interval Scheduling
Greedy Algorithm to find the **maximum number** of mutually compatible jobs## Problem Statement
- Job j starts at s(j) and finishes at f(j)
- 2 jobs are **compatible** if they do not overlap (2nd job starts after or at the same time as the 1st one finishes)
- **Goal: find the maximum number of mutually compatible jobs**
- Example: 8 jobs {a, b, c, d, e, f, g, h}
### Optimal = {b, e, h}
## Algorithm
**Consider jobs in ascending order of finish time f(j)**### Sorted Jobs
### Pseudocode
## Runtime
Sorting O(n log(n)) + for-loop Θ(n)
**O(n log(n))**## References
- [Kevin Wayne Slides](https://www.cs.princeton.edu/~wayne/kleinberg-tardos/pearson/04GreedyAlgorithms-2x2.pdf)
- [University of Washington Slides](https://courses.cs.washington.edu/courses/cse421/07su/slides/04greed-4up.pdf)
- [T. M. Murali Slides](http://courses.cs.vt.edu/cs5114/spring2009/lectures/lecture04-greedy-scheduling.pdf)
- [Carl Kingsford Slides](https://www.cs.umd.edu/class/fall2009/cmsc451/lectures/Lec04-interval.pdf)
- [Violetta lonati Slides](http://lonati.di.unimi.it/algo/0910/lab/kowalski6.pdf)