From e22c1c5febc5dbefb8ff2a1b8a4abe7c96238ea9 Mon Sep 17 00:00:00 2001 From: lakshayroop5 <87693528+lavenroop5@users.noreply.github.com> Date: Sun, 9 Oct 2022 05:17:27 +0530 Subject: [PATCH 01/17] completed optimised code for job sequencing with deadline problem --- .../job_sequencing_with_deadline.py | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 greedy_methods/job_sequencing_with_deadline.py diff --git a/greedy_methods/job_sequencing_with_deadline.py b/greedy_methods/job_sequencing_with_deadline.py new file mode 100644 index 000000000000..88f6be4e302b --- /dev/null +++ b/greedy_methods/job_sequencing_with_deadline.py @@ -0,0 +1,33 @@ +# INPUT +N = int(input()) +jobs = [] +for i in range(N): + jobs.append(list(map(int, input().split()))) + +#OUTPUT +# SORT JOBS ACCORDING TO THEIR PROFIT +jobs.sort(key=lambda x: x[2], reverse=True) + +# FIND MAXIMUM DEADLINE +max_deadline = max(jobs, key=lambda x: x[1])[1] + +# INITIALIZE SLOTS +slots = [0] * max_deadline + +# FIND SLOTS FOR JOBS +for job in jobs: + for i in range(job[1]-1, -1, -1): + if slots[i] == 0: + slots[i] = job[0] + break + +# FIND PROFIT AND COUNT OF JOBS +count = 0 +profit = 0 +for i in slots: + if i != 0: + count += 1 + profit += jobs[i-1][2] + +# PRINTING NUMBER OF JOBS AND MAXIMUM PROFIT +print(count, profit) From d7cb01fa3b5a383b3cd62abe9bb9d7c30f961068 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 8 Oct 2022 23:56:04 +0000 Subject: [PATCH 02/17] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- greedy_methods/job_sequencing_with_deadline.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/greedy_methods/job_sequencing_with_deadline.py b/greedy_methods/job_sequencing_with_deadline.py index 88f6be4e302b..449c1d95fe1e 100644 --- a/greedy_methods/job_sequencing_with_deadline.py +++ b/greedy_methods/job_sequencing_with_deadline.py @@ -4,7 +4,7 @@ for i in range(N): jobs.append(list(map(int, input().split()))) -#OUTPUT +# OUTPUT # SORT JOBS ACCORDING TO THEIR PROFIT jobs.sort(key=lambda x: x[2], reverse=True) @@ -16,7 +16,7 @@ # FIND SLOTS FOR JOBS for job in jobs: - for i in range(job[1]-1, -1, -1): + for i in range(job[1] - 1, -1, -1): if slots[i] == 0: slots[i] = job[0] break @@ -27,7 +27,7 @@ for i in slots: if i != 0: count += 1 - profit += jobs[i-1][2] + profit += jobs[i - 1][2] -# PRINTING NUMBER OF JOBS AND MAXIMUM PROFIT +# PRINTING NUMBER OF JOBS AND MAXIMUM PROFIT print(count, profit) From 388b9781a04f61a66f0cf2aed89ba3db32f0e3c4 Mon Sep 17 00:00:00 2001 From: lakshayroop5 <87693528+lavenroop5@users.noreply.github.com> Date: Sun, 9 Oct 2022 06:23:19 +0530 Subject: [PATCH 03/17] completed optimised code for job sequencing with deadline problem --- greedy_methods/job_sequencing_with_deadline.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/greedy_methods/job_sequencing_with_deadline.py b/greedy_methods/job_sequencing_with_deadline.py index 88f6be4e302b..7854e2cb1a54 100644 --- a/greedy_methods/job_sequencing_with_deadline.py +++ b/greedy_methods/job_sequencing_with_deadline.py @@ -6,10 +6,10 @@ #OUTPUT # SORT JOBS ACCORDING TO THEIR PROFIT -jobs.sort(key=lambda x: x[2], reverse=True) +jobs.sort(key=lambda value: value[2], reverse=True) # FIND MAXIMUM DEADLINE -max_deadline = max(jobs, key=lambda x: x[1])[1] +max_deadline = max(jobs, key=lambda value: value[1])[1] # INITIALIZE SLOTS slots = [0] * max_deadline From f707dc27b7181c8e8bfc8e4c35afa428fd2bf065 Mon Sep 17 00:00:00 2001 From: Lakshay Roopchandani <75477853+lakshayroop5@users.noreply.github.com> Date: Sun, 9 Oct 2022 06:25:32 +0530 Subject: [PATCH 04/17] completed optimized code for job sequencing with deadline problem --- greedy_methods/job_sequencing_with_deadline.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/greedy_methods/job_sequencing_with_deadline.py b/greedy_methods/job_sequencing_with_deadline.py index 449c1d95fe1e..f7df3429ae31 100644 --- a/greedy_methods/job_sequencing_with_deadline.py +++ b/greedy_methods/job_sequencing_with_deadline.py @@ -6,10 +6,10 @@ # OUTPUT # SORT JOBS ACCORDING TO THEIR PROFIT -jobs.sort(key=lambda x: x[2], reverse=True) +jobs.sort(key=lambda value: value[2], reverse=True) # FIND MAXIMUM DEADLINE -max_deadline = max(jobs, key=lambda x: x[1])[1] +max_deadline = max(jobs, key=lambda value: value[1])[1] # INITIALIZE SLOTS slots = [0] * max_deadline From de476be708f40b09db8e9d645c6fb58d4afa5305 Mon Sep 17 00:00:00 2001 From: lakshayroop5 <87693528+lavenroop5@users.noreply.github.com> Date: Sun, 9 Oct 2022 06:48:49 +0530 Subject: [PATCH 05/17] completed optimised code for job sequencing with deadline problem --- .../job_sequencing_with_deadline.py | 90 ++++++++++++------- 1 file changed, 57 insertions(+), 33 deletions(-) diff --git a/greedy_methods/job_sequencing_with_deadline.py b/greedy_methods/job_sequencing_with_deadline.py index 7854e2cb1a54..4795fea248ea 100644 --- a/greedy_methods/job_sequencing_with_deadline.py +++ b/greedy_methods/job_sequencing_with_deadline.py @@ -1,33 +1,57 @@ -# INPUT -N = int(input()) -jobs = [] -for i in range(N): - jobs.append(list(map(int, input().split()))) - -#OUTPUT -# SORT JOBS ACCORDING TO THEIR PROFIT -jobs.sort(key=lambda value: value[2], reverse=True) - -# FIND MAXIMUM DEADLINE -max_deadline = max(jobs, key=lambda value: value[1])[1] - -# INITIALIZE SLOTS -slots = [0] * max_deadline - -# FIND SLOTS FOR JOBS -for job in jobs: - for i in range(job[1]-1, -1, -1): - if slots[i] == 0: - slots[i] = job[0] - break - -# FIND PROFIT AND COUNT OF JOBS -count = 0 -profit = 0 -for i in slots: - if i != 0: - count += 1 - profit += jobs[i-1][2] - -# PRINTING NUMBER OF JOBS AND MAXIMUM PROFIT -print(count, profit) +""" +This is a pure Python implementation of the greedy-merge-sort algorithm + +For doctests run following command: +python3 -m doctest -v greedy_merge_sort.py +""" + +# FUNCTION + +from numpy import void + + +def job_sequencing_with_deadlines(N: int, jobs: list) -> list: + """ + Function to find the maximum profit by doing jobs in a given time frame + + Args: + N [int]: Number of jobs + jobs [list]: A list of tuples of (job_id, deadline, profit) + + Returns: + max_profit [int]: Maximum profit that can be earned by doing jobs + in a given time frame + + Examples: + >>> job_sequencing_with_deadlines(4, [(1, 4, 20), (2, 1, 10), (3, 1, 40), (4, 1, 30)]) + [2, 60] + >>> job_sequencing_with_deadlines(5, [(1, 2, 100), (2, 1, 19), (3, 2, 27), (4, 1, 25), (5, 1, 15)]) + [2, 127] + """ + + # Sort the jobs in descending order of profit + jobs = sorted(jobs, key=lambda value: value[2], reverse=True) + + # Create a list of size equal to the maximum deadline + # and initialize it with -1 + max_deadline = max(jobs, key=lambda x: x[1])[1] + time_slots = [-1] * max_deadline + + # Finding the maximum profit and the count of jobs + count = 0 + max_profit = 0 + for job in jobs: + # Find a free time slot for this job + # (Note that we start from the last possible slot) + for i in range(job[1] - 1, -1, -1): + if time_slots[i] == -1: + time_slots[i] = job[0] + count += 1 + max_profit += job[2] + break + return [count, max_profit] + +if __name__ == "__main__": + import doctest + + doctest.testmod() \ No newline at end of file From 017b3afb6e89fd3ee2eecf12d8f3f45d667f594e Mon Sep 17 00:00:00 2001 From: lakshayroop5 <87693528+lavenroop5@users.noreply.github.com> Date: Sun, 9 Oct 2022 07:33:02 +0530 Subject: [PATCH 06/17] completed optimised code for job sequencing with deadline problem --- greedy_methods/job_sequencing_with_deadline.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/greedy_methods/job_sequencing_with_deadline.py b/greedy_methods/job_sequencing_with_deadline.py index de8b60582dcd..d86bfc5824bb 100644 --- a/greedy_methods/job_sequencing_with_deadline.py +++ b/greedy_methods/job_sequencing_with_deadline.py @@ -7,12 +7,12 @@ """ # FUNCTION -def job_sequencing_with_deadlines(N: int, jobs: list) -> list: +def job_sequencing_with_deadlines(num_jobs: int, jobs: list) -> list: """ Function to find the maximum profit by doing jobs in a given time frame Args: - N [int]: Number of jobs + num_jobs [int]: Number of jobs jobs [list]: A list of tuples of (job_id, deadline, profit) Returns: @@ -31,7 +31,7 @@ def job_sequencing_with_deadlines(N: int, jobs: list) -> list: # Create a list of size equal to the maximum deadline # and initialize it with -1 - max_deadline = max(jobs, key=lambda x: x[1])[1] + max_deadline = max(jobs, key=lambda value: value[1])[1] time_slots = [-1] * max_deadline # Finding the maximum profit and the count of jobs From 51dcd9d9b625a3cd9e042f01af736974be938659 Mon Sep 17 00:00:00 2001 From: lakshayroop5 <87693528+lavenroop5@users.noreply.github.com> Date: Sun, 9 Oct 2022 07:41:24 +0530 Subject: [PATCH 07/17] completed optimised code for job sequencing with deadline problem --- greedy_methods/job_sequencing_with_deadline.py | 1 - 1 file changed, 1 deletion(-) diff --git a/greedy_methods/job_sequencing_with_deadline.py b/greedy_methods/job_sequencing_with_deadline.py index d86bfc5824bb..994464903548 100644 --- a/greedy_methods/job_sequencing_with_deadline.py +++ b/greedy_methods/job_sequencing_with_deadline.py @@ -52,4 +52,3 @@ def job_sequencing_with_deadlines(num_jobs: int, jobs: list) -> list: import doctest doctest.testmod() - From 02b0e81c252a81e4cbffe6b5a12c672fa2574532 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 9 Oct 2022 02:17:18 +0000 Subject: [PATCH 08/17] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- greedy_methods/job_sequencing_with_deadline.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/greedy_methods/job_sequencing_with_deadline.py b/greedy_methods/job_sequencing_with_deadline.py index 994464903548..7cdf471aefe2 100644 --- a/greedy_methods/job_sequencing_with_deadline.py +++ b/greedy_methods/job_sequencing_with_deadline.py @@ -33,7 +33,7 @@ def job_sequencing_with_deadlines(num_jobs: int, jobs: list) -> list: # and initialize it with -1 max_deadline = max(jobs, key=lambda value: value[1])[1] time_slots = [-1] * max_deadline - + # Finding the maximum profit and the count of jobs count = 0 max_profit = 0 @@ -48,6 +48,7 @@ def job_sequencing_with_deadlines(num_jobs: int, jobs: list) -> list: break return [count, max_profit] + if __name__ == "__main__": import doctest From 166dce98d5683ef21c59521602cf9e4f97334258 Mon Sep 17 00:00:00 2001 From: Lakshay Roopchandani <75477853+lakshayroop5@users.noreply.github.com> Date: Sun, 9 Oct 2022 14:06:07 +0530 Subject: [PATCH 09/17] completed optimized code for the issue "Job Scheduling with deadlines" --- greedy_methods/job_sequencing_with_deadline.py | 1 - 1 file changed, 1 deletion(-) diff --git a/greedy_methods/job_sequencing_with_deadline.py b/greedy_methods/job_sequencing_with_deadline.py index 7cdf471aefe2..f8eae1479f51 100644 --- a/greedy_methods/job_sequencing_with_deadline.py +++ b/greedy_methods/job_sequencing_with_deadline.py @@ -1,7 +1,6 @@ """ This is a pure Python implementation of the greedy-merge-sort algorithm -<<<<<<< HEAD For doctests run following command: python3 -m doctest -v greedy_merge_sort.py """ From e49c8e1e548464f619d01c47f07ba91cf0c81555 Mon Sep 17 00:00:00 2001 From: Lakshay Roopchandani <75477853+lakshayroop5@users.noreply.github.com> Date: Sun, 9 Oct 2022 14:13:33 +0530 Subject: [PATCH 10/17] completed optimized code for the issue "Job Scheduling with deadlines" --- greedy_methods/job_sequencing_with_deadline.py | 1 + 1 file changed, 1 insertion(+) diff --git a/greedy_methods/job_sequencing_with_deadline.py b/greedy_methods/job_sequencing_with_deadline.py index f8eae1479f51..8df637c17719 100644 --- a/greedy_methods/job_sequencing_with_deadline.py +++ b/greedy_methods/job_sequencing_with_deadline.py @@ -5,6 +5,7 @@ python3 -m doctest -v greedy_merge_sort.py """ + # FUNCTION def job_sequencing_with_deadlines(num_jobs: int, jobs: list) -> list: """ From 487829d1866e9f3ef4c81cba64c45d87846d8a02 Mon Sep 17 00:00:00 2001 From: Lakshay Roopchandani <75477853+lakshayroop5@users.noreply.github.com> Date: Sun, 9 Oct 2022 14:25:57 +0530 Subject: [PATCH 11/17] completed optimized code for the issue "Job Scheduling with deadlines" --- greedy_methods/job_sequencing_with_deadline.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/greedy_methods/job_sequencing_with_deadline.py b/greedy_methods/job_sequencing_with_deadline.py index 8df637c17719..0b9c096104fe 100644 --- a/greedy_methods/job_sequencing_with_deadline.py +++ b/greedy_methods/job_sequencing_with_deadline.py @@ -20,9 +20,11 @@ def job_sequencing_with_deadlines(num_jobs: int, jobs: list) -> list: in a given time frame Examples: - >>> job_sequencing_with_deadlines(4, [(1, 4, 20), (2, 1, 10), (3, 1, 40), (4, 1, 30)]) + >>> job_sequencing_with_deadlines(4, [(1, 4, 20), (2, 1, 10), \ + (3, 1, 40), (4, 1, 30)]) [2, 60] - >>> job_sequencing_with_deadlines(5, [(1, 2, 100), (2, 1, 19), (3, 2, 27), (4, 1, 25), (5, 1, 15)]) + >>> job_sequencing_with_deadlines(5, [(1, 2, 100), (2, 1, 19), \ + (3, 2, 27), (4, 1, 25), (5, 1, 15)]) [2, 127] """ From 3785de39025d10776e9c14eef0690f64e5de0d1d Mon Sep 17 00:00:00 2001 From: Lakshay Roopchandani <75477853+lakshayroop5@users.noreply.github.com> Date: Sun, 9 Oct 2022 17:33:12 +0530 Subject: [PATCH 12/17] Update greedy_methods/job_sequencing_with_deadline.py Co-authored-by: Christian Clauss --- greedy_methods/job_sequencing_with_deadline.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/greedy_methods/job_sequencing_with_deadline.py b/greedy_methods/job_sequencing_with_deadline.py index 0b9c096104fe..052268c71611 100644 --- a/greedy_methods/job_sequencing_with_deadline.py +++ b/greedy_methods/job_sequencing_with_deadline.py @@ -20,8 +20,8 @@ def job_sequencing_with_deadlines(num_jobs: int, jobs: list) -> list: in a given time frame Examples: - >>> job_sequencing_with_deadlines(4, [(1, 4, 20), (2, 1, 10), \ - (3, 1, 40), (4, 1, 30)]) + >>> job_sequencing_with_deadlines(4, [(1, 4, 20), (2, 1, 10), + ... (3, 1, 40), (4, 1, 30)]) [2, 60] >>> job_sequencing_with_deadlines(5, [(1, 2, 100), (2, 1, 19), \ (3, 2, 27), (4, 1, 25), (5, 1, 15)]) From 10e72763cff67579c1336fff86b52415d65c76a4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 9 Oct 2022 12:04:00 +0000 Subject: [PATCH 13/17] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- greedy_methods/job_sequencing_with_deadline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/greedy_methods/job_sequencing_with_deadline.py b/greedy_methods/job_sequencing_with_deadline.py index 052268c71611..f2243f3346bc 100644 --- a/greedy_methods/job_sequencing_with_deadline.py +++ b/greedy_methods/job_sequencing_with_deadline.py @@ -20,7 +20,7 @@ def job_sequencing_with_deadlines(num_jobs: int, jobs: list) -> list: in a given time frame Examples: - >>> job_sequencing_with_deadlines(4, [(1, 4, 20), (2, 1, 10), + >>> job_sequencing_with_deadlines(4, [(1, 4, 20), (2, 1, 10), ... (3, 1, 40), (4, 1, 30)]) [2, 60] >>> job_sequencing_with_deadlines(5, [(1, 2, 100), (2, 1, 19), \ From 500231be15ca911d7eb68f0925770a6fc3560e8e Mon Sep 17 00:00:00 2001 From: Lakshay Roopchandani <75477853+lakshayroop5@users.noreply.github.com> Date: Sun, 9 Oct 2022 17:59:01 +0530 Subject: [PATCH 14/17] Updated reviews --- greedy_methods/job_sequencing_with_deadline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/greedy_methods/job_sequencing_with_deadline.py b/greedy_methods/job_sequencing_with_deadline.py index f2243f3346bc..c80e321e77d5 100644 --- a/greedy_methods/job_sequencing_with_deadline.py +++ b/greedy_methods/job_sequencing_with_deadline.py @@ -24,7 +24,7 @@ def job_sequencing_with_deadlines(num_jobs: int, jobs: list) -> list: ... (3, 1, 40), (4, 1, 30)]) [2, 60] >>> job_sequencing_with_deadlines(5, [(1, 2, 100), (2, 1, 19), \ - (3, 2, 27), (4, 1, 25), (5, 1, 15)]) + ... (3, 2, 27), (4, 1, 25), (5, 1, 15)]) [2, 127] """ From a0b4d5214d8ccbbfa4984524892a3c9af1e7a4ac Mon Sep 17 00:00:00 2001 From: Lakshay Roopchandani <75477853+lakshayroop5@users.noreply.github.com> Date: Sun, 9 Oct 2022 18:01:46 +0530 Subject: [PATCH 15/17] Updated reviews --- greedy_methods/job_sequencing_with_deadline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/greedy_methods/job_sequencing_with_deadline.py b/greedy_methods/job_sequencing_with_deadline.py index c80e321e77d5..3882ee6fb58e 100644 --- a/greedy_methods/job_sequencing_with_deadline.py +++ b/greedy_methods/job_sequencing_with_deadline.py @@ -23,7 +23,7 @@ def job_sequencing_with_deadlines(num_jobs: int, jobs: list) -> list: >>> job_sequencing_with_deadlines(4, [(1, 4, 20), (2, 1, 10), ... (3, 1, 40), (4, 1, 30)]) [2, 60] - >>> job_sequencing_with_deadlines(5, [(1, 2, 100), (2, 1, 19), \ + >>> job_sequencing_with_deadlines(5, [(1, 2, 100), (2, 1, 19), ... (3, 2, 27), (4, 1, 25), (5, 1, 15)]) [2, 127] """ From c577d7e9654d28de3ad6bca48277d6675ec5c855 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 9 Oct 2022 12:33:20 +0000 Subject: [PATCH 16/17] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- greedy_methods/job_sequencing_with_deadline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/greedy_methods/job_sequencing_with_deadline.py b/greedy_methods/job_sequencing_with_deadline.py index 3882ee6fb58e..013cb3305784 100644 --- a/greedy_methods/job_sequencing_with_deadline.py +++ b/greedy_methods/job_sequencing_with_deadline.py @@ -23,7 +23,7 @@ def job_sequencing_with_deadlines(num_jobs: int, jobs: list) -> list: >>> job_sequencing_with_deadlines(4, [(1, 4, 20), (2, 1, 10), ... (3, 1, 40), (4, 1, 30)]) [2, 60] - >>> job_sequencing_with_deadlines(5, [(1, 2, 100), (2, 1, 19), + >>> job_sequencing_with_deadlines(5, [(1, 2, 100), (2, 1, 19), ... (3, 2, 27), (4, 1, 25), (5, 1, 15)]) [2, 127] """ From 0eff505ebcd71e7face0975b8ddd6eb6cb6067e6 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 9 Oct 2022 14:49:19 +0200 Subject: [PATCH 17/17] Update and rename greedy_methods/job_sequencing_with_deadline.py to scheduling/job_sequencing_with_deadline.py --- .../job_sequencing_with_deadline.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) rename {greedy_methods => scheduling}/job_sequencing_with_deadline.py (76%) diff --git a/greedy_methods/job_sequencing_with_deadline.py b/scheduling/job_sequencing_with_deadline.py similarity index 76% rename from greedy_methods/job_sequencing_with_deadline.py rename to scheduling/job_sequencing_with_deadline.py index 013cb3305784..7b23c0b3575f 100644 --- a/greedy_methods/job_sequencing_with_deadline.py +++ b/scheduling/job_sequencing_with_deadline.py @@ -1,12 +1,3 @@ -""" -This is a pure Python implementation of the greedy-merge-sort algorithm - -For doctests run following command: -python3 -m doctest -v greedy_merge_sort.py -""" - - -# FUNCTION def job_sequencing_with_deadlines(num_jobs: int, jobs: list) -> list: """ Function to find the maximum profit by doing jobs in a given time frame @@ -20,11 +11,11 @@ def job_sequencing_with_deadlines(num_jobs: int, jobs: list) -> list: in a given time frame Examples: - >>> job_sequencing_with_deadlines(4, [(1, 4, 20), (2, 1, 10), - ... (3, 1, 40), (4, 1, 30)]) + >>> job_sequencing_with_deadlines(4, + ... [(1, 4, 20), (2, 1, 10), (3, 1, 40), (4, 1, 30)]) [2, 60] - >>> job_sequencing_with_deadlines(5, [(1, 2, 100), (2, 1, 19), - ... (3, 2, 27), (4, 1, 25), (5, 1, 15)]) + >>> job_sequencing_with_deadlines(5, + ... [(1, 2, 100), (2, 1, 19), (3, 2, 27), (4, 1, 25), (5, 1, 15)]) [2, 127] """