Applied Optimization with Julia
University of Hamburg - Fall 2024
Vlćek et al. (2024)
Question: What makes the work of emergency services complex?
Emergency services address the needs of three interest groups:
Question: What could be the objectives of these groups?
Note
Aligning the objectives of the three interest groups is challenging.
Question: Why might current district layouts be suboptimal?
How can we improve
this situation?
Question: What data can help improve emergency services?
Note
Extensive data collected, but often lack of tools or knowledge to leverage it.
For an efficient and effective distribution of resources, police jurisdictions are divided into precincts or command districts with separate departments. These are further divided into patrol beats (D’Amico et al. 2002).
Note
Part of the force patrols the streets, another part is stationed at the departments.
Question: What could be the potential problem?
Warning
This is a common problem in many emergency services.
Question: What affects response time?
Aggregation of small geographic areas, called basic areas (BAs), into geographic clusters, called districts, so that these are acceptable according to pre-defined planning criteria1.
Question: What could be the objective?
Question: What could be further objectives?
Question: How can we structure this?
Question: Advantages of hexagons?
Question: How can we model response time?
Conclusion
We focus on minimizing expected driving times between departments and incident locations.
Let’s build our model
step by step!
Question: What could be our key model components?
Question: Which are sets, parameters, and variables?
Note
The depot locations are a subset of the basic areas!
Question: What parameters do we need?
Tip
Parameters should be carefully calibrated with real-world data!
We have the following sets:
Our objective is to:
Minimize the expected response time of the emergency services by optimizing the assignment of BAs to departments.
Question: What decisions do we need to model?
Question: What is the domain of our decision variable?
Let’s build our
objective function!
Our objective is to:
Minimize the expected response time of the emergency services by optimizing the assignment of BAs to departments.
Question: How do we minimize response time?
Question: What could be our objective function?
\[ \text{minimize} \quad \sum_{i \in \mathcal{I}}\sum_{j \in \mathcal{J}} t_{i,j} \times X_{i,j} \]
Expected Driving Time
Question: Constraints needed?
Question: Why do we need this constraint?
We need the following variables:
Question: What could the constraint look like?
\[ \sum_{i \in \mathcal{I}} X_{i,j} = 1 \quad \forall j \in \mathcal{J} \]
Note
Each BA must be assigned to exactly one department.
The goal of these constraints is to:
Ensure that exactly \(p\) departments are opened.
We need the following sets and variables:
Question: What could the constraint look like?
\[ \sum_{i \in \mathcal{I}} X_{i,i} = p \]
Question: What happens if we have more departments than potential locations?
The goal of these constraints is to:
Ensure that each BA is assigned to an active department, e.g. a department that is opened and that could dispatch vehicles.
We need the following sets and variables:
Question: How do we ensure assignments only to active departments?
\[ X_{i,j} \leq X_{i,i} \quad \forall i \in \mathcal{I}, \forall j \in \mathcal{J} \]
Note
This constraint creates a logical connection between department locations and BA assignments where BAs can only be assigned to opened departments.
\[\begin{align} \text{minimize} \quad & \sum_{i \in \mathcal{I}}\sum_{j \in \mathcal{J}} t_{i,j} \times X_{i,j} \\ \text{subject to:} \quad & \sum_{i \in \mathcal{I}} X_{i,j}= 1 && \forall j \in \mathcal{J} \\ & \sum_{i \in \mathcal{I}} X_{i,i} = p && \\ & X_{i,j} \leq X_{i,i} && \forall i \in \mathcal{I}, \forall j \in \mathcal{J} \\ & X_{i,j} \in \{0,1\} && \forall i \in \mathcal{I}, \forall j \in \mathcal{J} \end{align}\]
Question: Why is contiguity important?
Compactness
Compactness has no univocal definition; a district is commonly declared compact if it is ‘somehow round-shaped and undistorted’ (Kalcsics, Nickel, and Schröder 2005).
Question: Are our resulting districts based on the model contiguous and compact?
Question: Is this likely for police service districting?
Additional Set and Parameter
\[ \mathcal{N}_{i,j}=\{v \in \mathcal{A}_j | e_{i,v} < e_{i,j}\} \quad \forall i\in \mathcal{I}, \forall j\in \mathcal{J} \]
The idea
BAs closer to department \(i\) than BA \(j\) on euclidian distance and adjacent to \(j\)!
All districts have to be contiguous
\[ X_{i,j} \leq \sum_{v \in \mathcal{N}_{i,j}} X_{i,v} \quad \forall i \in \mathcal{I}, \forall j \in \mathcal{J} \setminus \mathcal{A}_i: i \neq j \]
The idea
At least one department has to be assigned to a BA that is adjacent to BA \(j\) and closer to department \(i\)!
All districts have to be contiguous and compact
\[\begin{align*} X_{i,j} &\leq \sum_{v \in \mathcal{N}_{i,j}}X_{i,v} && \forall i \in \mathcal{I}, \forall j \in \mathcal{J} \setminus \mathcal{A}_i:|\mathcal{N}_{i,j}|= 1 \wedge i \neq j \\ 2X_{i,j} &\leq \sum_{v \in \mathcal{N}_{i,j}}X_{i,v} && \forall i \in \mathcal{I}, \forall j \in \mathcal{J} \setminus \mathcal{A}_i:|\mathcal{N}_{i,j}|> 1 \wedge i \neq j \end{align*}\]
The idea
At least one department has to be assigned to two BAs that are adjacent to BA \(j\) and closer to department \(i\)!
Why does this work?
Due to the constraints, there is always a path back to the department if a BA is assigned to a department!
Questions: On model characteristics
Questions: On model assumptions
Question: Where did we apply our model?
Goal: Redesign districts to improve response time.
Goal: Optimize coverage with limited resources.
Question: How did we validate the results?
Important
All improvements are without additional staff!
Tip
Success requires balancing theoretical optimization with practical constraints!
Question: Where else could this approach be useful?
Note
The methodology is adaptable to various public service optimization scenarios.
And that’s it for todays lecture!
We now have covered districting problems and are ready to start solving some tasks in the upcoming tutorial.
Questions?
For more interesting literature to learn more about Julia, take a look at the literature list of this course.
Lecture VIII - Police Districting | Dr. Tobias Vlćek | Home