Block 4 · Lesson 34 · Where We Left Off
Three lessons built the threat picture one layer at a time:
Block 4 · Lesson 34 · Objectives
By the end of this lesson, you will be able to:
Block 4 · Lesson 34 · Graphs
So the best route is the cheapest path — once you decide what "cost" means.
Block 4 · Lesson 34 · Dijkstra
Block 4 · Lesson 34 · Dijkstra
Block 4 · Lesson 34 · Cost Design
Block 4 · Lesson 34 · Cost Design
Block 4 · Lesson 34 · Trade-off
Fly the safest point that still fits left of the line.
Block 4 · Lesson 34 · Grid
shortestpath takes milliseconds.Block 4 · Lesson 34 · Aspect
Same two nodes, two costs: a digraph, not a graph.
Block 4 · Lesson 34 · Honesty
Dijkstra is exact — for the cost you gave it. The cost is only as honest as the model:
Beyond Dijkstra: continuous optimization (fmincon, particle swarm) smooths the route off the grid.
Block 4 · Lesson 34 · Quick Exercise
Type this with me — six nodes, eight legs, one kill probability per leg.
% L34 -- the safest route is a shortest path on -ln(1-p)
s = [1 1 2 2 3 3 4 5]; % leg start nodes
t = [2 3 3 4 4 5 6 6]; % leg end nodes
p = [.20 .10 .05 .25 .15 .05 .12 .08]; % P_K on each leg
G = graph(s, t, -log(1-p)); % additive risk cost
[route, r] = shortestpath(G, 1, 6);
fprintf('%-10s P_S = %.3f\n', mat2str(route), exp(-r))
G.Edges.Weight(findedge(G,3,5)) = -log(1-0.40); % pop-up on 3-5
[route, r] = shortestpath(G, 1, 6);
fprintf('%-10s P_S = %.3f\n', mat2str(route), exp(-r))
Check the first line by hand: multiply $(1-p)$ along the route.
Then: make $p$ itself the weight. Same routes? Same $P_S$?
Block 4 · Lesson 34 · Quick Problem
A four-node ingress: IN, turn points A and B, and TGT. Each leg has a length $\ell$ and an exposure $r = \sum\lambda\ell$.
L34_RoutePlanner.m
Block 4 · Lesson 34 · Wrap-Up
digraph