I need to find an optimal distribution of some matching tasks on multiple jobs; each job is limited by a maximum workload and the grouped tasks should maximize the workload within the same job.However, tasks with similar values within the same source should have a higher priority to be included in the same job.For example:Input tasks with the expected workloadTask  Source1  Source2  Workload  1     A        A        40  2     A        B        15  3     B        A        48  4     B        B        18  5     C        A        32  6     C        B        24  7     A        C        8In case the maximum workload is 50, the tasks should be distributed as follows. Job1Task  Source1  Source2  Workload  1     A        A        40  7     A        C        8Job2Task  Source1  Source2  Workload  2     A        B        15  6     C        B        24Job3Task  Source1  Source2  Workload  3     B        A        48Job4Task  Source1  Source2  Workload  4     B        B        18  5     C        A        32Any clues?
Optimal load distribution with maximum workload
algorithms;load balancing