I am looking for a Python developer with experience in ORTools to solve a task scheduling problem. The project needs to be completed within a timeframe of 1-2 weeks.
Specific constraints are involved in the scheduling problem, so the ideal candidate should be able to work with these requirements.
The client has detailed information about the daily budgets and costs, which will be crucial in solving the problem. Therefore, the developer should be able to utilize this information effectively.
Skills and experience needed for this project:
- Proficiency in Python and ORTools
- Experience in solving task scheduling problems
- Ability to work with specific constraints
- Strong analytical and problem-solving skills.
Using ORTools to solve a scheduling problem. You will write an optimization function called schedule_tasks using Python.
The optimization will schedule tasks within a project. Below are requirements for the Project and Tasks.
Project Requirements
- Projects consist of many tasks that must be able to execute in any order and in parallel to complete the project in the shortest time possible.
- Projects are paid for from a bank account on a daily budget.
- The expected daily adjustments to the bank account are represented as an array called balance_adjustments. If the number is positive, consider it a deposit. If it is negative, consider it a withdrawal.
for example in the case below, the project is funded at 1000 per day for 24 days:
balance_adjustments = [1000, 1000, 1000, 1000,1000, 1000, 1000, 1000,1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000]
Task Requirements
- Tasks must be able to occur in any order and parallel when possible
- Tasks have associated daily costs that will be deducted from the bank account in the days they are scheduled.
- The expected daily costs for a task are represented as an array
- One or more tasks will be provided to the optimization function in a data structure called settlements. If the value is positive, consider it a cost and a reduction to the bank account. If the value is negative, consider it a deposit (refund) to the account.
- Tasks cannot have their days split. Once started, they must continue each day until completed.
for example the data below represents 4 projects with daily costs:
settlements = {0: [750, 500, 250, 250, 250, 250],
1: [100, 250,250,250,250,250],
2: [500, 250, 250, 250],
3: [350, 350,350,350]}
Running Balance:
The solution must keep track of a daily running balance of the bank account. The first day of the project is the first day of the balance adjustments. The daily balance should be calculated as the balance_adjustments element for that day minus the sum of the daily costs for the tasks scheduled for that day. Any remaining budget for the day carries over to the next day. The daily balance can never go below zero.
Optimized Result:
The optimized result should be the shortest possible number of days to complete all tasks while never going below 0 in the 'bank'.
You will include test data and the function call at the end of the code you produce as below:
/# Test Cases:
balance_adjustments = [1000, 1000, 1000, 1000,1000, 1000, 1000, 1000,1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000]
settlements = {0: [750, 500, 250, 250, 250, 250], 1: [100, 250,250,250,250,250], 2: [500, 250, 250, 250], 3: [350, 350,350,350]}
The function should be called as schedule_tasks(balance_adjustments, settlements) and should return the optimized solution as well as the daily running balance array.