473,396 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Employee Scheduling

Good Afternoon,

I am working on solving a scheduling problem for a company. Here are a few facts:

The company begins projects up to several times each week. This year they have 75 projects that have either already started or will start before the end of the year. Regardless of when the project is completed, all are considered 2018 projects if they begin on any day in 2018.

Each project is composed of a predefined set of tasks.

Each task can require a different number of mechanics with different specialized skill sets. However, any mechanic with the needed skill set can work on any task the needs their skillset.


Each task also has to be performed in a specific workshop and requires specific tools.

Some tasks require the same tools and some do not. Tools are not viewed as pre-packaged kits, but as a individual needs for a specific task that is being performed.

In order to maximize scheduling efficiency for mechanics, workshops, tools, each project can follow one of 8 different project designs.

The projects can last from 2 hours up to several hundred work days.

Tasks can last from 15 minutes to 8 hours.

Work days are 8 hours long with a 1 hour lunch break.

Some work days are 12 or 14 hours long. However each of these days occurs at a specific time depending on which project design is being used.


I am able to create a composite work schedule for projects. The company only works Monday thru Friday and takes off recognized holidays. Since the date that a project begins is scheduled in advance we are able to easily develop a daily schedule of tasks to be completed using simple SQL queries.


The difficult part, and the reason for my post, is determining the minimum number of mechanics that the company needs to have on duty each day to cover the tasks that are scheduled. As well as determining the hours that we need to schedule those mechanics to work each day.



I have used basic SQL to determine which hour long time periods during the day require mechanics to be on duty and how many need to be available during each specified time period. However, this does not answer the ultimate question, "What is the minimum number of mechanics that need to be on duty each day?"




Has anyone ran into a similar situation? Does anyone have any recommendations on how to calculate this number?
Aug 19 '18 #1
9 4094
zmbd
5,501 Expert Mod 4TB
What have you tried so far, you mention a partial SQL solution, can you post the SQL script (please use the [CODE/] format tool)?

While we're happy to help, we do need to have you do the initial work so that we have a better understanding of what is you are after and the environment within which you are working otherwise you may get a Fortran or COBOL solution when you need C++ or SQLLite when you Need an Oracle...
Aug 19 '18 #2
Hello @zmbd sorry for the lack of information. Using MS Access. Below is the sql query that I am using to come up with the number of staff that we need for the different hours of the work day.

Just for the sake of clarity, this code does not lead me what I am seeking. While this tells me the number of mechanics that are needed per hour, it does not take into account the overlap that mechanics can work. For example, a mechanic who is needed for 8:00 to 10:30 for one task can also be assigned to work on a task from 3:00 until 5:00.

In addition, based on company rules and the need to complete administrative work, mechanics are only scheduled to work on task completion 7 hours each day. The other 1 hour of their shift is spent on administrative work.


Expand|Select|Wrap|Line Numbers
  1. SELECT tbl_work_schedule.task_work_date AS [Date], 
  2. Sum([tbl_work_schedule].[0800 - 0900]*[tbl_work_schedule].[team_1_mechanics_required]) AS [0800 - 0900], 
  3. Sum([tbl_work_schedule].[0900 - 1000]*[tbl_work_schedule].[team_1_mechanics_required]) AS [0900 - 1000], 
  4. Sum([tbl_work_schedule].[1000 - 1100]*[tbl_work_schedule].[team_1_mechanics_required]) AS [1000 - 1100], 
  5. Sum([tbl_work_schedule].[1200 - 1300]*[tbl_work_schedule].[team_1_mechanics_required]) AS [1200 - 1300], 
  6. Sum([tbl_work_schedule].[1300 - 1400]*[tbl_work_schedule].[team_1_mechanics_required]) AS [1300 - 1400], 
  7. Sum([tbl_work_schedule].[1400 - 1500]*[tbl_work_schedule].[team_1_mechanics_required]) AS [1400 - 1500], 
  8. Sum([tbl_work_schedule].[1500 - 1600]*[tbl_work_schedule].[team_1_mechanics_required]) AS [1500 - 1600], 
  9. Sum([tbl_work_schedule].[1600 - 1700]*[tbl_work_schedule].[team_1_mechanics_required]) AS [1600 - 1700], 
  10.  
  11. FROM tbl_work_schedule
  12.  
  13. GROUP BY tbl_work_schedule.task_work_date
  14.  
  15. HAVING (((tbl_work_schedule.task_work_date) Between [Forms]![frm_team_1_mechanics_required]![txtbox_start_date] And [Forms]![frm_mechanics_required_]![txtbox_end_date]));
Aug 20 '18 #3
zmbd
5,501 Expert Mod 4TB
+ I've moved your thread to the Access Forum so that you'll get a bit more traffic on the question.

!! There are several "project" planning/scheduling software platforms available in the market place, have you looked into these? Yes, I know that these can be pricy; however, what you are attempting is fairly complex combining assets, resource, and employee scheduling databases into one application - not for the faint of heart and will in the long run be beyond what we can do for you. One of these applications may suit the bill better than an in-house development

+ Looking at your SQL you have fields with names such as ].[0800 - 0900]*[ which leads me to question the level of normalization within your database.
This lack of normalization may be the roadblock in getting your staffing levels.

+ Can you give us a general layout of your tables?
[Table1] with 1:M with [Table2] and M:1 with [Table3]
(field list)
[Table2]
(field list)
[Table3] with M:1 with [Table1]
(field list)
etc...
At minimum it sounds like you need (other Experts will help refine or have suggestions for these) ((tables names such that [This to That] are a linking table between the two:
- [Projects]
- [Project Design] <<< Need a bit more detail about this, you have 8 different ones; however, we have no detail about how these actually relate to your work flow
- [Tasks]
- [Mechanics]
- [Skills]
- [Projects to Project Design]
- [Tasks to Skills]
- [Mechanics to Skills]
- [Projects to Tasks]
- [Tools]
- [Workshops]
- [Tools to Workshops]
- more tables to deal with the calendar aspect... I'll have to think about these a bit more and the Holiday thing adds a chink

(also the field names in your SQL are a bit wonky, while allowed, I highly advise against anything other than Alphanumeric and the Underscore in field/table names - no spaces and no special characters outside of the underscore.
You'll also want to avoid using Names for field, table, query, VBA Procedure, Form ,Form Controls, and Variable such as "Name" and at least the ones listed here: http://allenbrowne.com/AppIssueBadWord.html
Aug 20 '18 #4
PhilOfWalton
1,430 Expert 1GB
I'm very much in agreement with zmbd that your project whilst probably do-able, is going to be extremely difficult to do using Access. There are too many variables.

Suppose there are two projects, Project 1 and Project 2. we have a timeline for both projects and find that a specialist tool is required for both projects at the same time. So we pause the start of Project 2 so that the tool requirements no longer clash. As a result, where there was no conflict before, the need for specialist mechanics clashe. So another variable, do you add another pause to the Project 2 or get hold of a second mechanic?

Bearing in mind you are "SoonToBeRetired" I guess that happy event could happen well before your project is completed.

Phil
Aug 20 '18 #5
NeoPa
32,556 Expert Mod 16PB
Would I be correct if I assumed that the maximum number of mechanics required for the day would be equal to the largest value of mechanics required per hour?
I suspect not. However, if that isn't true then I don't believe you have the information available to calculate or determine what the actual value is.

You can only calculate with the information available, so that's critical to what results you can even look for. I hope that makes sense.
Aug 20 '18 #6
Rabbit
12,516 Expert Mod 8TB
If you have the number needed per hour for a day, then the minimum number needed for that day should be the maximum number for any hour in that day.
Aug 21 '18 #7
zmbd
5,501 Expert Mod 4TB
what-if
There are multiple projects concurrent to each other...
Would that mean then that the largest Sum() of the number of mechanics for any given hour within the day be the minimum staffing? Does this change if the projects cross shift schedules - notice OP has the staffing per scheduled shift glitch in there...
Aug 21 '18 #8
NeoPa
32,556 Expert Mod 16PB
I'm thinking of a scenario where a single engineer with skillset A starts the day and works for one hour only. Later that day two engineers are required with skillset B. The first engineer doesn't have skillset B so we need three engineers at least - even though the maximum for any individual hour is only two.

I should have explained this scenario better when I was asking the question in my earlier post.
Aug 21 '18 #9
Rabbit
12,516 Expert Mod 8TB
@zmbd, it should hold even if it crosses shifts

@neopa, that would change things. If only certain people could work on certain projects, then I suppose you could take the Hungarian Algorithm and modify it for the purposes here.

Each worker and job would need to be represented multiple times broken down by hour in the matrix. Those missing a skill for a job could be assigned a high cost so they don't get assigned that job. If the jobs are more complicated than one worker per job, further adjustments to the algorithm are probably needed.

You would also need to dynamically adjust the worker's "costs" as they get assigned so they don't get an overlapping shift but also, non-overlapping jobs for that day should get cheaper for that worker so they can be assigned other jobs for that day. Correctly doing this cost update would be crucial to solving the problem.

Anyways, it's a tricky optimization problem. The Hungarian Algorithm is one method of solving the problem. But it was meant to solve a simplified version: one worker one job. Many modifications to it would be needed to get it working for this particular scenario. Details of the base implementation in the article below.

https://bytes.com/topic/access/insig...rian-algorithm
Aug 21 '18 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Tony Proctor | last post by:
Hi everyone We're experiencing some serious anomalies with the scheduling of ASP threads. I'd be interested to hear if anyone knows what algorithm is used (e.g. simple round-robin, or something...
3
by: lisa[nospam].xxx | last post by:
Hello! I need help to organize the working time spent by each employee on projects. I thought this wuold be a rather simple probelm, but i realized it is not!! I have many projects going on,...
7
by: Neil Greenough | last post by:
I am looking for a scheduling template or will maybe have a go at creating the database myself. Basically, the database will include a table listing certain volunteers, their volunteer number...
3
by: tstutting | last post by:
Hello, This is my first post and I'd really appreciate any help I can get. Sorry this is so long but it's complicated. I'm a USAF Officer and I'm attempting to make a shared MS Access DB that...
4
by: Dinsdale | last post by:
I'm looking at adding scheduling features to an application and I wanted to ask the community about any experience with scheduling components, either open source like from code project or from a...
2
Ritchie
by: Ritchie | last post by:
Please can anyone help me with d programs in C for CPU scheduling: WAP to show FCFS scheduling algorithm. WAP to show SJF scheduling algorithm. WAP to show Priority scheduling algorithm. WAP...
2
by: JennDavila | last post by:
Hello, I am running into an issue with adding a form that displays a calendar to where the manager can click a day and it will attach itself to a tracking table. I am new to this and have been...
0
by: CaptBravo | last post by:
I'm working on a home care scheduling program. I built the thing using Access due to all the related tables/data, etc, but have been stymied when it came to creating a scheduling calendar. Here's...
16
by: osmosisgg | last post by:
Hello All, I've grabbed the db Patients from this website and am attempting to tweak it. I took the tblPatients and made it into EmployeeHours. The fields are now: employee, typeofleave,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.