Create nearby teams based on C # employee schedules

I am assigned csv employee schedules with columns:

employee ID, first last name, sunday schedule, monday schedule, ... , saturday schedule

1 weekly schedule for each employee. I added a screenshot of the csv file part. A common file has about 300 lines.

schedules.csv

I need to create teams of 15 on the basis of employee schedules (places do not matter) so that the employees of each team have the closest schedules to each other. The pseudo code of what I tried:

  • parse csv file into schedule array (my own structure definition)

  • match employees who have the same exact schedule in teams (creates ~ 5 full-sized teams, 20-25 half-filled teams, leaves ~ 50 schedules that don't match anyone)

  • for i = 1 to 14, for each member of size groups, I find the team with the closest schedule (in general) and add it to this team. Once the team reaches size 15, mark them as done.

It worked a few, but definitely did not give me the best teams. My question is: does anyone know a better way to do this? Pseudocode or just a general idea will help, thanks.

EDIT: Here is an example of a comparison formula. Comparison is based on half-hour blocks of the difference between agent charts. Agent 25 has a score of 16 because he has a difference of 8 full hours with agents 23 and 24. The total team score is 32 based on all the ratings added together.

Comparison

8 , , "". , , . , 7:00 15:00 , 8:00 16:00 - .

+4
2

, , , , , , , , .

:

1) .

2) , . , , (, , , - ), .

(2) , , , .

+1

, . , , , . , kitten sitting 3, 2 1 . , .

, , . k-means , , . , . , , .

+1

Source: https://habr.com/ru/post/1678741/


All Articles