Demonstrating All Slide Types & Best Practices
A comprehensive reference deck for layouts, media, code, and teaching patterns.
By the end of this presentation, you will be able to:
What if every presentation you gave was remembered and acted upon?
This is the most common slide type. It features:
Design Tip
The slide title should be a complete thought, not just a topic label. “Heuristics Trade Speed for Optimality” is better than “Heuristics”.
Text Column
Two-column layouts are effective for:
The 55/45 or 60/40 split gives text slightly more emphasis.
Constructive
Build solutions from scratch
Example: Nearest Neighbor
Improvement
Start with a solution and refine
Example: 2-opt, 3-opt
Metaheuristic
Escape local optima strategically
Example: SA, GA, Tabu
47%
Reduction in delivery costs using optimized routing
Compared to nearest-neighbor baseline across 50 test instances
The goal is to turn data into information, and information into insight.
— Carly Fiorina, former HP CEO
This quote illustrates the value chain of analytics: raw data → processed information → actionable insight.
Every warehouse decision is a trade-off between space, time, and money.
Figure 2: The optimization landscape showing local vs global optima. Heuristics help navigate this terrain efficiently.
See Figure 2 for the visualization. This demonstrates the challenge of escaping local optima.
The process shown in Figure 3 illustrates the decision point between batch and single-order picking strategies.
| Algorithm | Time Complexity | Quality | Best For |
|---|---|---|---|
| Nearest Neighbor | \(O(n^2)\) | Fair | Quick baseline |
| Savings | \(O(n^2 \log n)\) | Good | VRP variants |
| 2-opt | \(O(n^2)\) per iter | Very Good | TSP improvement |
| LKH | \(O(n^{2.2})\) | Excellent | Large TSP |
As shown in Table 1, algorithm choice depends on problem size and quality requirements.
import numpy as np
def nearest_neighbor(distance_matrix: np.ndarray) -> list[int]:
"""Construct a tour using the Nearest Neighbor heuristic."""
n = len(distance_matrix)
# Initialize: start at depot (node 0)
visited = [False] * n
tour = [0]
visited[0] = True
current = 0
# Greedily visit nearest unvisited node
for _ in range(n - 1):
# Find nearest unvisited neighbor
nearest = min(
(j for j in range(n) if not visited[j]),
key=lambda j: distance_matrix[current][j]
)
tour.append(nearest)
visited[nearest] = True
current = nearest
tour.append(0) # Return to depot
return tour# Create sample distance matrix
np.random.seed(42)
n = 5
coords = np.random.rand(n, 2) * 100
# Calculate distances
dist = np.zeros((n, n))
for i in range(n):
for j in range(n):
dist[i,j] = np.linalg.norm(
coords[i] - coords[j]
)
# Run algorithm
tour = nearest_neighbor(dist)
cost = sum(dist[tour[i], tour[i+1]]
for i in range(len(tour)-1))
print(f"Tour: {tour}")
print(f"Cost: {cost:.2f}")Output:
Tour: [0, 2, 4, 3, 1, 0]
Cost: 247.89
Interpretation
The algorithm visits nodes in order of proximity, producing a feasible but not necessarily optimal tour.
Consider the Traveling Salesman Problem (TSP):
\[ \min \sum_{i=1}^{n} \sum_{j=1}^{n} c_{ij} x_{ij} \tag{1}\]
Subject to:
\[ \sum_{j=1}^{n} x_{ij} = 1, \quad \forall i \in V \tag{2}\]
\[ \sum_{i=1}^{n} x_{ij} = 1, \quad \forall j \in V \tag{3}\]
Where \(x_{ij} \in \{0, 1\}\) indicates if edge \((i,j)\) is in the tour.
See Equation 1 for the objective function.
Exercise: Manual 2-opt Calculation
Given the distance matrix below and initial tour A → B → C → D → A:
| A | B | C | D | |
|---|---|---|---|---|
| A | 0 | 10 | 15 | 20 |
| B | 10 | 0 | 35 | 25 |
| C | 15 | 35 | 0 | 30 |
| D | 20 | 25 | 30 | 0 |
Task: Calculate the cost change (Δ) if we reverse segment [B, C].
Time: 5 minutes
Step 1: Identify edges to remove
Step 2: Identify edges to add
Step 3: Calculate Δ
\[\Delta = (15 + 25) - (10 + 30) = 40 - 40 = 0\]
Result
Δ = 0: This move does not improve the solution. Try reversing [B, C, D] instead!
Note: Information
Used for supplementary information that’s helpful but not critical.
Tip: Best Practice
Used for recommendations and best practices.
Warning: Caution
Used for potential pitfalls or common mistakes.
Important: Critical
Used for essential information that must not be missed.
15:00
Please return by 10:45 AM
Email: jane.smith@university.edu
Office Hours: Tuesday & Thursday, 14:00–16:00
Course Site: moodle.university.edu/course
Match slide type to content purpose — Use section dividers for transitions, emphasis boxes for impact moments
Apply multimedia learning principles — Combine words with visuals, segment complex information
Use Quarto features for professional output — Cross-references, citations, labeled elements
Include speaker notes — Document your design rationale for future reference
Dr. Jane Smith
jane.smith@university.edu
Slides created with Quarto and reveal.js
BEFORE: Unoptimized
AFTER: Optimized
Full-bleed images create emotional connection
def two_opt(tour: list[int], dist: np.ndarray) -> list[int]:
"""Improve tour using 2-opt local search.
Args:
tour: Initial tour as list of node indices
dist: Distance matrix
Returns:
Improved tour
"""
improved = True
best_tour = tour.copy()
while improved:
improved = False
for i in range(1, len(best_tour) - 2):
for j in range(i + 2, len(best_tour) - 1):
# Calculate improvement
delta = (
dist[best_tour[i-1], best_tour[j]] +
dist[best_tour[i], best_tour[j+1]] -
dist[best_tour[i-1], best_tour[i]] -
dist[best_tour[j], best_tour[j+1]]
)
if delta < -1e-10:
# Reverse segment
best_tour[i:j+1] = reversed(best_tour[i:j+1])
improved = True
break
if improved:
break
return best_tour