-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add Interval Scheduling (Greedy Algorithm) and Tests #537
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
Add Interval Scheduling (Greedy Algorithm) and Tests #537
Conversation
7e073f6
to
d720622
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #537 +/- ##
==========================================
- Coverage 96.64% 96.63% -0.01%
==========================================
Files 275 277 +2
Lines 10865 10883 +18
Branches 1541 1544 +3
==========================================
+ Hits 10500 10517 +17
Misses 232 232
- Partials 133 134 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d720622
to
6017b94
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds an Interval Scheduling implementation using a greedy algorithm to solve the problem of selecting the maximum number of non-overlapping jobs from a given set. The algorithm sorts jobs by their end time and iteratively selects jobs that don't overlap with previously chosen ones.
Key changes:
- Implementation of greedy interval scheduling algorithm
- Comprehensive test suite covering edge cases and various scenarios
- Documentation updates to include the new algorithm in the project structure
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
README.md | Added documentation entries for Job Scheduling algorithms including Interval Scheduling |
Algorithms/Problems/JobScheduling/Job.cs | Defines a Job record representing intervals with start and end times |
Algorithms/Problems/JobScheduling/IntervalSchedulingSolver.cs | Implements the greedy interval scheduling algorithm |
Algorithms.Tests/Problems/JobScheduling/IntervalSchedulingSolverTests.cs | Comprehensive test suite covering various scheduling scenarios |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Algorithms.Tests/Problems/JobScheduling/IntervalSchedulingSolverTests.cs
Show resolved
Hide resolved
Please check review comments |
c7a8407
to
07b91b4
Compare
I'm done @siriak |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Algorithms.Tests/Problems/JobScheduling/IntervalSchedulingSolverTests.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
Interval Scheduling (Greedy Algorithm)
Interval Scheduling solves the problem of selecting the maximum number of non-overlapping jobs (or intervals) from a given set. Each job has a start and end time. The greedy approach sorts jobs by their end time and iteratively selects jobs that do not overlap with previously chosen ones.
Use case
Work shift planning, meeting room booking, resource allocation.
Unit Test Evidence