In the 2025 SAS INNOVATE conference, there was an interesting talk about a problem that a health care system had. This particular health care system had caregivers who travel to homes of patients, and they wanted to optimize their workforce. They used the SAS computing system’s machine learning algorithms to find the best staffing level, and had great success with this. And in this case “best” staffing level was that which allowed caregivers to get to the patients with the right amount of workload, not too much and not too little.
This reminds us of the time our consulting head optimized the placement of sheriff deputies for a largely non-urban county in upstate New York. The problem is that the deputies travel about the county, and incidents occur, some more commonly at specific times of the day than others. Incidents might be traffic accidents, which largely occur during the morning commute, or burglaries, which occur in the evening but more so in the summer. Where do you place the deputies to minimize response times, especially to critical events? And does this vary by season and time of day? To answer these questions, we follow the standard modeling process:
- Collect data
- Create a model
- Optimize the model
Collect data
The county is modeled as towns and roads linking those towns. As an example, we have Charles County, MD. There are numerous highways and intersections, usually in towns or townships. Those intersections are the nodes to be modeled.
Mathematically, you have what is called a “graph”. And we want to know the times (“distances” in graph theory speak) between the nodes in the graph. To do so, we need to collect data on driving time among these nodes. No AI or ML model will work without appropriate data, and biased data yields biased models. How do we get the data? Our recommendation is to drive around, recording the time. TimeCatchApp makes this easy, where the data are automatically collected and centrally available all the time, with no data entry errors and no lost drive logs.
Load the nodes where times are to be collected, and assign the tasks to our drivers. Each pair of nodes is a task. To record the time, click on the clocked in button and start driving to the other node.
Once you reach the destination, stop the vehicle (please do not click on the app and drive at the same time), and click the clock out button. Do this at different times of the day, and get several drives for each leg as you will want to get variability information. Why? Because in the real world, things happen that cause delay, and you will want a robust model that works under most circumstances. Don’t collect only the best case, but collect what is realistic.
Analyze data
Because you were capturing data in TimeCatchApp, all of the driving times are stored automatically. You simply need to go to the project time report and download it.
To download, click on the download button at the top, and select the data format. In the case, you will want CSV since we want to process the data in a computing language such as SAS or R.
There you go. In just seconds, you have the data. Furthermore, it is available for audit by your customer.
“Did you really collect the data?”
“Why yes, we even know who collected each time point! We are happy to offer complete transparency, and if you want to replicate our findings, well here are the data.”
Model and Optimize
Once you have the data collected, or even during the collection process, you can create the simulation model, with vehicles taking time to go from node to node responding to service requests. Service requests would come in based on some arrival model. For the hospital example, the service requests are fixed for any given day, but are spaced randomly on the map. In the sheriff example, the service requests arrive in a random fashion at random spots based and vehicles respond to those.
The data for the service requests will need to come from the dispatch records. To simplify, can attach each dispatch request to a node, with the time and location frequency based on the prior data.
At this point, there is some objective function we are trying to minimize. For the health care example, it was maximizing the amount of time spent caring for patients with the constraint that health care workers could not work more than their allotted work schedule. Clearly you can always care for more patients simply by working longer hours, but the point of the exercise was to ensure that the caregivers worked only the standard workday. For the sheriff example, the objective was to minimize response times given the constraint of the number of deputies, since the budget for deputies is fixed by the county board of supervisors.
The number and placement of service vehicles would be the parameters of the model, along with possibly other factors. Finally, the model can be optimized using an appropriate optimization algorithm, such as a genetic optimizer. It would be much too detailed to describe all optimizers as there are literally hundreds, so we will end this description here.
Conclusion
This process can work in a number of areas, not just medical or emergency services. Similar processes work with consulting resource planning, job shop optimization, amusement park traffic flow, janitorial services, etc. The process we describe can be summarized in 3 easy steps:
- Collect data using an automated tool such as TimeCatchApp
- Analyze the data to create the model
- Optimize the model
If you would like help or guidance on any of these steps, please contact TimeCatchApp.