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 workload
Task 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 8
In case the maximum workload is 50, the tasks should be distributed as follows.
Job1 Task Source1 Source2 Workload 1 A A 40 7 A C 8 Job2 Task Source1 Source2 Workload 2 A B 15 6 C B 24 Job3 Task Source1 Source2 Workload 3 B A 48 Job4 Task Source1 Source2 Workload 4 B B 18 5 C A 32
Any clues?