# Lesson 34 Flashcards

Click a question to reveal the answer.

<div data-flashcards data-deck="b4l34"></div>

<details>
<summary><strong>1. How does route planning become a shortest-path problem?</strong></summary>
<div class="card-answer"><p>Lay a graph over the map: nodes are places the aircraft can be (waypoints or grid-cell centers), edges are legs it can fly, and each edge carries a non-negative weight — what that leg costs. A route's cost is the sum of its legs' weights, so the best route is the cheapest path from ingress to target.</p></div>
</details>

<details>
<summary><strong>2. State the two operations Dijkstra's algorithm repeats.</strong></summary>
<div class="card-answer"><p><strong>Settle</strong> the frontier node with the smallest label <span class="math notranslate nohighlight">\(g(u)\)</span> — that label is now final — then <strong>relax</strong> every edge out of it: <span class="math notranslate nohighlight">\(g(v) \leftarrow \min\big(g(v),\ g(u) + c_{uv}\big)\)</span>. Repeat until the target settles, then walk the predecessors back to read the route.</p></div>
</details>

<details>
<summary><strong>3. Why must Dijkstra's edge weights be non-negative?</strong></summary>
<div class="card-answer"><p>Settling the smallest label is safe only because every other way into that node starts at a label at least as large and adds weights that cannot be negative. A negative edge could undercut a node after it was settled, and the algorithm would return a wrong answer.</p></div>
</details>

<details>
<summary><strong>4. What is the difference between a tentative label and a settled one?</strong></summary>
<div class="card-answer"><p>A tentative label is the cheapest cost-to-come found so far, and relaxation can still lower it when a cheaper way in turns up. A settled label is final. In the lesson's worked example, B is first reached at 5 directly and then drops to 4 through A before it settles.</p></div>
</details>

<details>
<summary><strong>5. When do you use <code>graph</code> and when <code>digraph</code> in MATLAB?</strong></summary>
<div class="card-answer"><p><code>graph(s, t, w)</code> stores one weight per node pair, usable both ways — right when a leg costs the same in each direction. <code>digraph</code> stores one-way edges, so a leg that costs something different each way is two edges with two weights. <code>shortestpath(G, s, t)</code> runs Dijkstra on either.</p></div>
</details>

<details>
<summary><strong>6. What goes wrong with a distance-only cost? With an exposure-only cost?</strong></summary>
<div class="card-answer"><p>Distance only finds the shortest route — straight through whatever threat is in the way. Exposure only has no reason to stop wandering: every unexposed leg is free, so any zero-exposure dogleg ties for best however long it is, and the planner can return a route no aircraft has the fuel to fly.</p></div>
</details>

<details>
<summary><strong>7. What does the weight <span class="math notranslate nohighlight">\(w = w_r/w_d\)</span> mean in the blended cost?</strong></summary>
<div class="card-answer"><p>In <span class="math notranslate nohighlight">\(c_e = w_d\,\ell_e + w_r\,r_e\)</span> only the ratio matters, so set <span class="math notranslate nohighlight">\(w_d = 1\)</span>: <span class="math notranslate nohighlight">\(w\)</span> is the number of km of extra flying you will accept to cut the exposure <span class="math notranslate nohighlight">\(\sum r\)</span> by one unit. At <span class="math notranslate nohighlight">\(w = 200\)</span> km the planner flies 2 km farther to cut the exposure by 0.01.</p></div>
</details>

<details>
<summary><strong>8. Why is the exposure edge weight <span class="math notranslate nohighlight">\(-\ln(1-p)\)</span>?</strong></summary>
<div class="card-answer"><p>Survival multiplies along a route, <span class="math notranslate nohighlight">\(P_S = \prod(1-p_e)\)</span>, but Dijkstra adds. Taking <span class="math notranslate nohighlight">\(-\ln\)</span> turns the product into a sum, <span class="math notranslate nohighlight">\(-\ln P_S = \sum -\ln(1-p_e)\)</span>, and because the log is monotone the minimum-sum route is exactly the maximum-<span class="math notranslate nohighlight">\(P_S\)</span> route.</p></div>
</details>

<details>
<summary><strong>9. Why not just add the raw <span class="math notranslate nohighlight">\(p\)</span>'s along a route?</strong></summary>
<div class="card-answer"><p><span class="math notranslate nohighlight">\(p \approx -\ln(1-p)\)</span> only while <span class="math notranslate nohighlight">\(p\)</span> is small. With one heavy leg against several light ones the raw sum can pick the wrong route: one leg at 0.40 sums lower than two at 0.22 (0.40 against 0.44), yet its survival is 0.600 against 0.608.</p></div>
</details>

<details>
<summary><strong>10. How does L31's hazard turn a threat into an edge weight?</strong></summary>
<div class="card-answer"><p>A site takes a shot every <span class="math notranslate nohighlight">\(\Delta s\)</span> km, each killing with <span class="math notranslate nohighlight">\(p_\text{shot}\)</span>, so its hazard is <span class="math notranslate nohighlight">\(\lambda = -\ln(1-p_\text{shot})/\Delta s\)</span> per km. An edge that spends <span class="math notranslate nohighlight">\(\ell_{i,e}\)</span> km inside site <span class="math notranslate nohighlight">\(i\)</span>'s lethal zone (detection range and MEZ both) carries <span class="math notranslate nohighlight">\(r_e = \sum_i \lambda_i \ell_{i,e}\)</span>, and the route survives with <span class="math notranslate nohighlight">\(P_S = e^{-\sum r_e}\)</span>.</p></div>
</details>

<details>
<summary><strong>11. What is the Pareto front, and how do you trace it?</strong></summary>
<div class="card-answer"><p>Run Dijkstra once for each weight <span class="math notranslate nohighlight">\(w\)</span> in a sweep and plot each route's survival against its length. The front is the set of routes no other route beats on both at once; it shows what each increment of <span class="math notranslate nohighlight">\(P_S\)</span> costs in kilometers.</p></div>
</details>

<details>
<summary><strong>12. How is a fuel limit applied, and why not inside Dijkstra?</strong></summary>
<div class="card-answer"><p>Apply it to the sweep's answers: fly the highest-<span class="math notranslate nohighlight">\(P_S\)</span> route whose length fits under <span class="math notranslate nohighlight">\(L_\text{max}\)</span>, or call the mission infeasible if even the shortest route does not fit. A length budget inside Dijkstra would need a second label per node (length used), which breaks its one-label exactness — the hard resource-constrained shortest-path problem.</p></div>
</details>

<details>
<summary><strong>13. What does an 8-connected grid give you, and what does it cost?</strong></summary>
<div class="card-answer"><p>Cell centers become nodes, each linked to 8 neighbors by 10 km legs and <span class="math notranslate nohighlight">\(10\sqrt{2} = 14.1\)</span> km diagonals, so any map becomes a graph. The caveats: headings only every 45°, routes that zig-zag and run up to about 8% long, rings that snap to cells, and many equal-length ties.</p></div>
</details>

<details>
<summary><strong>14. Why does aspect make the route graph directed?</strong></summary>
<div class="card-answer"><p>A leg's heading sets the aspect each radar sees, <span class="math notranslate nohighlight">\(\theta = \phi + 180^\circ - \psi\)</span>. Flown toward a radar the leg shows the nose; flown away it shows the tail. The RCS differs, so <span class="math notranslate nohighlight">\(R_\text{det} \propto \sigma^{1/4}\)</span>, the lethal length and the risk differ, and one node pair carries two costs — a <code>digraph</code>.</p></div>
</details>

<details>
<summary><strong>15. What goes wrong if you plan aspect-blind?</strong></summary>
<div class="card-answer"><p>With the worst-case <span class="math notranslate nohighlight">\(\sigma\)</span> it is always pessimistic: every ring is at its largest and it pays length to avoid threats it could have slipped past. With the nose-on <span class="math notranslate nohighlight">\(\sigma\)</span> it is optimistic wherever the aircraft is louder than its nose (it flies past radars beam-on) and pessimistic wherever it is quieter. Re-score the route with the real pattern.</p></div>
</details>

<details>
<summary><strong>16. What does "low cost is not low risk" mean for a planner?</strong></summary>
<div class="card-answer"><p>Dijkstra is exact for the cost it is given, and that cost is a model's promise — a <span class="math notranslate nohighlight">\(\sigma\)</span>, hazards, rings and a grid. In the demo, a nose-on plan promises <span class="math notranslate nohighlight">\(P_S = 1.000\)</span> through a gap that the aspect-aware model re-scores at 0.077. Re-score every plan under a better model than the one that chose it.</p></div>
</details>
