-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
502 lines (452 loc) · 27.6 KB
/
index.html
File metadata and controls
502 lines (452 loc) · 27.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Route Optimization in Navigation Systems</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css"
integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="css/home.css" />
<link rel="shortcut icon" href="assets/vincelogo.svg" type="image/x-icon" />
</head>
<body>
<header class="hero">
<div class="container">
<p class="eyebrow">
<i class="fa-solid fa-location-dot"></i>
Navigation Systems
</p>
<h1>Route Optimization in Navigation Systems</h1>
<p class="hero-text">
Have you ever wondered how Google Maps or Apple Maps finds the most optimal route
to your destination? Route optimization is the process of determining the <strong>shortest path</strong>
between two locations in a network. Navigation systems do this by modeling real-world road networks as
a <strong>weighted graph</strong>, where intersections are nodes, roads are edges, and travel cost (such
as time or distance) are the weights. Then shortest path algorithms, like <strong>Dijkstra's
Algorithm</strong>, are used to compute the route with the quickest travel time.
</p>
</div>
</header>
<main class="container">
<!-- SECTION 1 -->
<section class="card">
<h2>1. Weighted Graphs</h2>
<p>
A <strong>weighted graph</strong> is a way of representing connected things where
each connection has a value or cost attached to it. A weighted graph is made of <strong>nodes</strong>
(points), <strong>edges</strong> (connections between points), and <strong>weights</strong> (the cost to
travel along an edge).
</p>
<div class="panel">
<div class="panel-header">
<h3>Weighted Graph Example</h3>
</div>
<div class="svg-shell">
<svg viewBox="0 0 700 340" class="graph-svg" aria-label="Weighted graph example">
<!-- edges -->
<line x1="120" y1="170" x2="300" y2="90" class="edge" />
<line x1="120" y1="170" x2="300" y2="250" class="edge" />
<line x1="300" y1="90" x2="520" y2="170" class="edge" />
<line x1="300" y1="250" x2="520" y2="170" class="edge" />
<line x1="300" y1="90" x2="300" y2="250" class="edge" />
<!-- weights -->
<text x="210" y="115" class="weight-label">4</text>
<text x="210" y="235" class="weight-label">2</text>
<text x="410" y="115" class="weight-label">5</text>
<text x="410" y="235" class="weight-label">3</text>
<text x="315" y="177" class="weight-label">6</text>
<!-- nodes -->
<circle cx="120" cy="170" r="30" class="node" />
<circle cx="300" cy="90" r="30" class="node" />
<circle cx="300" cy="250" r="30" class="node" />
<circle cx="520" cy="170" r="30" class="node" />
<!-- node labels -->
<text x="120" y="172" class="node-label">A</text>
<text x="300" y="92" class="node-label">B</text>
<text x="300" y="252" class="node-label">C</text>
<text x="520" y="172" class="node-label">D</text>
<!-- example callouts -->
<text x="85" y="220" class="diagram-label">Node</text>
<line x1="120" y1="205" x2="120" y2="190" class="label-line" />
<text x="210" y="175" class="diagram-label">Edge</text>
<line x1="253" y1="165" x2="290" y2="140" class="label-line" />
<text x="460" y="70" class="diagram-label">Weight</text>
<line x1="460" y1="78" x2="420" y2="102" class="label-line" />
</svg>
</div>
<div class="legend">
<span><span class="legend-dot legend-default"></span> Node</span>
<span><span class="legend-line"></span> Edge</span>
<span><span class="legend-weight">4</span> Weight</span>
</div>
</div>
</section>
<!-- SECTION 2 -->
<section class="card">
<h2>2. Graph Representation of Road Networks</h2>
<p>
To compute routes, a real road network is needed to be transformed into a weighted graph.
</p>
<div class="feature-grid">
<div class="feature-box">
<i class="fa-solid fa-circle-nodes"></i>
<h3>Nodes</h3>
<p>Intersections or endpoints of roads.</p>
</div>
<div class="feature-box">
<i class="fa-solid fa-road"></i>
<h3>Edges</h3>
<p>Roads themselves.</p>
</div>
<div class="feature-box">
<i class="fa-solid fa-stopwatch"></i>
<h3>Weights</h3>
<p>Travel cost such as time, distance, speed limits or traffic delay.</p>
</div>
</div>
<div class="split-grid">
<div class="panel">
<div class="panel-header">
<h3>Street Layout</h3>
<p>How a road system looks in the real world</p>
</div>
<div class="svg-shell">
<svg viewBox="0 0 500 340" class="graph-svg" aria-label="Street layout">
<line x1="80" y1="70" x2="80" y2="270" class="road-line" />
<line x1="240" y1="70" x2="240" y2="270" class="road-line" />
<line x1="400" y1="70" x2="400" y2="270" class="road-line" />
<line x1="80" y1="100" x2="400" y2="100" class="road-line" />
<line x1="80" y1="200" x2="400" y2="200" class="road-line" />
<circle cx="80" cy="100" r="9" class="intersection" />
<circle cx="240" cy="100" r="9" class="intersection" />
<circle cx="400" cy="100" r="9" class="intersection" />
<circle cx="80" cy="200" r="9" class="intersection" />
<circle cx="240" cy="200" r="9" class="intersection" />
<circle cx="400" cy="200" r="9" class="intersection" />
<text x="68" y="85" class="mini-label">A</text>
<text x="228" y="85" class="mini-label">B</text>
<text x="388" y="85" class="mini-label">C</text>
<text x="68" y="225" class="mini-label">D</text>
<text x="228" y="225" class="mini-label">E</text>
<text x="388" y="225" class="mini-label">F</text>
</svg>
</div>
</div>
<div class="panel">
<div class="panel-header">
<h3>Converted Graph</h3>
<p>The same layout represented as a graph</p>
</div>
<div class="svg-shell">
<svg viewBox="0 0 500 340" class="graph-svg" aria-label="Converted weighted graph">
<line x1="90" y1="90" x2="250" y2="90" class="edge" />
<line x1="250" y1="90" x2="410" y2="90" class="edge" />
<line x1="90" y1="250" x2="250" y2="250" class="edge" />
<line x1="250" y1="250" x2="410" y2="250" class="edge" />
<line x1="90" y1="90" x2="90" y2="250" class="edge" />
<line x1="250" y1="90" x2="250" y2="250" class="edge" />
<line x1="410" y1="90" x2="410" y2="250" class="edge" />
<circle cx="90" cy="90" r="24" class="node" />
<circle cx="250" cy="90" r="24" class="node" />
<circle cx="410" cy="90" r="24" class="node" />
<circle cx="90" cy="250" r="24" class="node" />
<circle cx="250" cy="250" r="24" class="node" />
<circle cx="410" cy="250" r="24" class="node" />
<text x="90" y="94" class="node-label node-label-sm">A</text>
<text x="250" y="94" class="node-label node-label-sm">B</text>
<text x="410" y="94" class="node-label node-label-sm">C</text>
<text x="90" y="254" class="node-label node-label-sm">D</text>
<text x="250" y="254" class="node-label node-label-sm">E</text>
<text x="410" y="254" class="node-label node-label-sm">F</text>
</svg>
</div>
</div>
</div>
</section>
<!-- SECTION 3 -->
<section class="card">
<h2>3. Dijkstra's Algorithm, the Computation Process</h2>
<p>
Dijkstra's Algorithm computes the <strong>shortest path</strong>, the path with the smallest total
cost, on weighted graphs though a repetative process of selecting the node with the smallest
current cost and updating it's neighbors. This process repeats until the destination node has been
processed or all nodes have been processed.
</p>
<div class="algorithm-foundation">
<div class="feature-grid">
<div class="feature-box">
<i class="fa-solid fa-play"></i>
<h3>Initialization</h3>
<p>
The algorithm sets a distance of 0 to the starting node and sets all other nodes to a
distance of infinity to indicate that no path to them has been discovered yet.
</p>
</div>
<div class="feature-box">
<i class="fa-solid fa-arrows-rotate"></i>
<h3>Relaxation</h3>
<p>
When at a node. The algorithm inspects all of the neigbors surrounding that node.
If that neighbor currently has a distance of infinity (not discovered), it is set to the
current travel cost. If the neighbor does have a value, the algorithm
compares said value to the current travel cost and updates to the smaller cost. The
algorithm will then perform the selection step.
</p>
</div>
<div class="feature-box">
<i class="fa-solid fa-arrow-down-short-wide"></i>
<h3>Selection</h3>
<p>When selecting, the algorithm will select from all unvisted discovered nodes (ones that
aren't set to infinity). The algorithm will select the node with the current smallest cost
of this group, move to said node and perform the relaxation step.
</p>
</div>
</div>
</div>
<p>
In the demo below, it follows though Dijkstra's computational process.
For this example <strong>A</strong> is the starting node and <strong>E</strong> is the destination node.
</p>
<div class="interactive-demo">
<div class="panel">
<div class="svg-shell">
<svg viewBox="0 0 700 360" class="graph-svg" id="dijkstraGraph"
aria-label="Interactive Dijkstra graph">
<line id="edge-ab" x1="120" y1="180" x2="300" y2="90" class="edge demo-edge" />
<line id="edge-ac" x1="120" y1="180" x2="300" y2="270" class="edge demo-edge" />
<line id="edge-bd" x1="300" y1="90" x2="520" y2="90" class="edge demo-edge" />
<line id="edge-cd" x1="300" y1="270" x2="520" y2="90" class="edge demo-edge" />
<line id="edge-be" x1="300" y1="90" x2="520" y2="270" class="edge demo-edge" />
<line id="edge-de" x1="520" y1="90" x2="520" y2="270" class="edge demo-edge" />
<text x="205" y="120" class="weight-label">4</text>
<text x="205" y="255" class="weight-label">2</text>
<text x="410" y="75" class="weight-label">5</text>
<text x="355" y="210" class="weight-label">8</text>
<text x="380" y="135" class="weight-label">10</text>
<text x="535" y="185" class="weight-label">2</text>
<circle id="node-a" cx="120" cy="180" r="32" class="node demo-node node-start" />
<circle id="node-b" cx="300" cy="90" r="32" class="node demo-node" />
<circle id="node-c" cx="300" cy="270" r="32" class="node demo-node" />
<circle id="node-d" cx="520" cy="90" r="32" class="node demo-node" />
<circle id="node-e" cx="520" cy="270" r="32" class="node demo-node node-end" />
<text x="120" y="184" class="node-label">A</text>
<text x="300" y="94" class="node-label">B</text>
<text x="300" y="274" class="node-label">C</text>
<text x="520" y="94" class="node-label">D</text>
<text x="520" y="274" class="node-label">E</text>
<g id="dist-a">
<rect x="85" y="225" width="70" height="34" rx="10" class="distance-box" />
<text x="120" y="247" class="distance-text">0</text>
</g>
<g id="dist-b">
<rect x="265" y="15" width="70" height="34" rx="10" class="distance-box" />
<text x="300" y="37" class="distance-text">∞</text>
</g>
<g id="dist-c">
<rect x="265" y="315" width="70" height="34" rx="10" class="distance-box" />
<text x="300" y="337" class="distance-text">∞</text>
</g>
<g id="dist-d">
<rect x="485" y="15" width="70" height="34" rx="10" class="distance-box" />
<text x="520" y="37" class="distance-text">∞</text>
</g>
<g id="dist-e">
<rect x="485" y="315" width="70" height="34" rx="10" class="distance-box" />
<text x="520" y="337" class="distance-text">∞</text>
</g>
</svg>
</div>
</div>
<div class="panel">
<div class="step-badge" id="stepNumber">Step 1</div>
<h3 id="stepTitle">Initialization</h3>
<p id="stepDescription">
The algorithm initializes by setting the distance to node A to 0 and all other nodes are set to
infinity.
</p>
<div class="distance-table">
<div class="distance-row"><span>A</span><strong id="labelA">0</strong></div>
<div class="distance-row"><span>B</span><strong id="labelB">∞</strong></div>
<div class="distance-row"><span>C</span><strong id="labelC">∞</strong></div>
<div class="distance-row"><span>D</span><strong id="labelD">∞</strong></div>
<div class="distance-row"><span>E</span><strong id="labelE">∞</strong></div>
</div>
<div class="demo-controls">
<button id="prevBtn" class="demo-btn demo-btn-secondary">
<i class="fa-solid fa-arrow-left"></i>
Previous
</button>
<button id="nextBtn" class="demo-btn demo-btn-primary">
Next
<i class="fa-solid fa-arrow-right"></i>
</button>
</div>
</div>
</div>
</section>
<!-- SECTION 4 -->
<section class="card">
<h2>4. Putting the Graph Model and Dijkstra's Algorithm Together</h2>
<p>
Here you can see the full process of the street network, the weighted graph representation of the street
network, and Dijkstra's Algorithm in progress. For this example <strong>A</strong> is the starting node
and <strong>F</strong> is the destination node.
</p>
<p class="foundation-note">
<span class="def">Remember:</span>
<span class="def"><strong>Nodes</strong> = Intersections</span>
<span class="def"><strong>Edges</strong> = Physical Roads</span>
<span class="def"><strong>Weights</strong> = Travel Cost</span>
</p>
<div class="split-grid">
<div class="panel">
<div class="panel-header">
<h3>Street Network</h3>
<p>The real-world road view</p>
</div>
<div class="svg-shell">
<svg viewBox="0 0 560 340" class="graph-svg" aria-label="Street network example">
<line x1="90" y1="80" x2="90" y2="270" class="road-line" />
<line x1="250" y1="80" x2="250" y2="270" class="road-line" />
<line x1="430" y1="80" x2="430" y2="270" class="road-line" />
<line x1="90" y1="110" x2="430" y2="110" class="road-line" />
<line x1="90" y1="210" x2="430" y2="210" class="road-line" />
<circle cx="90" cy="110" r="10" class="intersection" />
<circle cx="250" cy="110" r="10" class="intersection" />
<circle cx="430" cy="110" r="10" class="intersection" />
<circle cx="90" cy="210" r="10" class="intersection" />
<circle cx="250" cy="210" r="10" class="intersection" />
<circle cx="430" cy="210" r="10" class="intersection" />
<text x="78" y="92" class="mini-label">A</text>
<text x="238" y="92" class="mini-label">B</text>
<text x="418" y="92" class="mini-label">C</text>
<text x="78" y="236" class="mini-label">D</text>
<text x="238" y="236" class="mini-label">E</text>
<text x="418" y="236" class="mini-label">F</text>
<polyline points="90,110 250,110 250,210 430,210" class="route-line" />
</svg>
</div>
</div>
<div class="panel">
<div class="panel-header">
<h3>Auto Route Selection</h3>
<p>Dijkstra's Algorithm in progress</p>
</div>
<div class="svg-shell">
<svg viewBox="0 0 560 360" class="graph-svg" id="loopGraph"
aria-label="Automatic route selection demo">
<line id="loop-edge-ab" x1="100" y1="100" x2="260" y2="100" class="edge loop-edge" />
<line id="loop-edge-bc" x1="260" y1="100" x2="430" y2="100" class="edge loop-edge" />
<line id="loop-edge-ad" x1="100" y1="100" x2="100" y2="250" class="edge loop-edge" />
<line id="loop-edge-be" x1="260" y1="100" x2="260" y2="250" class="edge loop-edge" />
<line id="loop-edge-cf" x1="430" y1="100" x2="430" y2="250" class="edge loop-edge" />
<line id="loop-edge-de" x1="100" y1="250" x2="260" y2="250" class="edge loop-edge" />
<line id="loop-edge-ef" x1="260" y1="250" x2="430" y2="250" class="edge loop-edge" />
<text x="180" y="87" class="weight-label">4</text>
<text x="345" y="87" class="weight-label">6</text>
<text x="82" y="180" class="weight-label">7</text>
<text x="242" y="180" class="weight-label">2</text>
<text x="412" y="180" class="weight-label">5</text>
<text x="180" y="237" class="weight-label">5</text>
<text x="345" y="237" class="weight-label">1</text>
<circle id="loop-node-a" cx="100" cy="100" r="25" class="node loop-node node-start" />
<circle id="loop-node-b" cx="260" cy="100" r="25" class="node loop-node" />
<circle id="loop-node-c" cx="430" cy="100" r="25" class="node loop-node" />
<circle id="loop-node-d" cx="100" cy="250" r="25" class="node loop-node" />
<circle id="loop-node-e" cx="260" cy="250" r="25" class="node loop-node" />
<circle id="loop-node-f" cx="430" cy="250" r="25" class="node loop-node node-end" />
<text x="100" y="104" class="node-label node-label-sm">A</text>
<text x="260" y="104" class="node-label node-label-sm">B</text>
<text x="430" y="104" class="node-label node-label-sm">C</text>
<text x="100" y="254" class="node-label node-label-sm">D</text>
<text x="260" y="254" class="node-label node-label-sm">E</text>
<text x="430" y="254" class="node-label node-label-sm">F</text>
</svg>
</div>
</div>
</div>
</section>
<!-- SECTION 5 -->
<section class="card">
<h2>5. The Complete Process Cycle</h2>
<p>
In short, navigation systems route optimization process could be broken down into 5 main stages.
</p>
<ol class="process-list">
<li>User inputs a destination</li>
<li>The system maps the surrounding road network to a weighted graph</li>
<li>Dijkstra's Algorithm starts computing the shortest path to your destination</li>
<li>The destination is reached with minimum travel cost</li>
<li>The optimal route is displayed</li>
</ol>
</section>
<!-- SECTION 6 -->
<section class="card">
<h2>6. Real-World Behavior of Navigation Systems</h2>
<p>
In real navigation systems, route optimization is not a one time calculation.
It is a <strong>continuous process</strong> that constantly adapts to changing conditions.
</p>
<div class="feature-grid">
<div class="feature-box">
<i class="fa-solid fa-traffic-light"></i>
<h3>Traffic...</h3>
<p>
Edge weights are continuously updated using real time traffic data,
meaning the travel cost of a road can change at any moment.
</p>
</div>
<div class="feature-box">
<i class="fa-solid fa-ban"></i>
<h3>Road Constraints</h3>
<p>
One way streets, turn restrictions, and construction close certain optimal routes, requiring
new ones to be calculated.
</p>
</div>
<div class="feature-box">
<i class="fa-solid fa-rotate"></i>
<h3>User Movement</h3>
<p>
If you miss a turn or decide to take a different path, a new optimal route must be computed in
real time.
</p>
</div>
</div>
</section>
<section class="card conclusion">
<h2>Conclusion</h2>
<p>
Navigation systems like Google Maps and Apple Maps determine the most optimal route by modeling road
networks as weighted graphs and applying shortest path algorithms, like Dijkstra's Algorithm, to find
the path with the smallest total travel cost. While Dijkstra's Algorithm guarantees a most optimal route
under fixed conditions, the real world is constantly changing. Traffic changes travel cost, construction
closes routes, and user movement could require recalculation, so the system must continuously update to
provide the most optimal route in real time.
</p>
<h3>References</h3>
<ul class="references-list">
<li>
“At the Core of Google Maps: Dijkstrals Algorithm.” <em>YouTube</em>, Strongly Connect,
www.youtube.com/watch?v=Kuyq_HLSPtI. Accessed 10 Apr. 2026.
</li>
<li>
Badola, Manoj. “Dijkstrals Algorithm in GPS Navigation (Google Maps).” <em>Medium</em>,
medium.com/@23bt04006/dijkstras-algorithm-in-gps-navigation-google-maps-finding-optimal-road-routes-0b5ca6df06e8.
Accessed 10 Apr. 2026.
</li>
<li>
“Find Shortest Paths from Source to All Vertices Using Dijkstrals Algorithm.”
<em>GeeksforGeeks</em>,
21 Jan. 2026, www.geeksforgeeks.org/dsa/dijkstras-shortest-path-algorithm-greedy-algo-7/.
</li>
</ul>
</section>
</main>
<script src="js/home.js"></script>
</body>
</html>