-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaxisearch.html
More file actions
276 lines (230 loc) · 8.12 KB
/
Copy pathtaxisearch.html
File metadata and controls
276 lines (230 loc) · 8.12 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>taxi-search — David Long</title>
<script>
if (localStorage.getItem("theme") === "dark") {
document.documentElement.classList.add("dark");
}
</script>
<style>
:root {
--bg: #ffffff;
--text: #000000;
--muted: #444444;
--link: #0000ee;
--rule: #000000;
--btn-bg: #f0f0f0;
--btn-border: #bbbbbb;
--btn-text: #555555;
}
html.dark {
--bg: #1c1c1c;
--text: #e8e8e8;
--muted: #aaaaaa;
--link: #7eb3ff;
--rule: #888888;
--btn-bg: #2a2a2a;
--btn-border: #555555;
--btn-text: #aaaaaa;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background: var(--bg);
color: var(--text);
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
line-height: 1.5;
}
.page {
max-width: 750px;
margin: 48px auto;
padding: 0 32px 64px;
}
#theme-toggle {
position: fixed;
top: 16px;
right: 20px;
padding: 5px 10px;
background: var(--btn-bg);
border: 1px solid var(--btn-border);
border-radius: 16px;
font-size: 11px;
color: var(--btn-text);
cursor: pointer;
}
.resume-name {
text-align: center;
font-size: 28px;
font-weight: bold;
margin-bottom: 6px;
}
.resume-contact {
text-align: center;
font-size: 13px;
color: var(--muted);
margin-bottom: 20px;
}
.resume-contact a {
color: var(--link);
}
.meta {
text-align: center;
font-size: 12px;
color: var(--muted);
margin-bottom: 10px;
}
.section-heading {
text-align: center;
font-size: 16px;
font-weight: bold;
border-bottom: 1px solid var(--rule);
margin-top: 24px;
margin-bottom: 10px;
padding-bottom: 2px;
}
.text-block {
font-size: 13px;
margin-bottom: 10px;
}
ul {
padding-left: 18px;
margin-top: 4px;
}
li {
font-size: 13px;
margin-bottom: 3px;
}
.back {
display: block;
font-size: 12px;
margin-bottom: 16px;
color: var(--link);
text-decoration: none;
}
.back:hover {
text-decoration: underline;
}
code {
background: var(--btn-bg);
padding: 2px 4px;
border-radius: 3px;
font-size: 12px;
}
.image-center {
display: flex;
justify-content: center;
margin: 10px 0;
margin-bottom: 14px;
}
.image-center img {
max-width: 260px;
width: 100%;
height: auto;
}
</style>
</head>
<body>
<button id="theme-toggle">
<span id="toggle-label">dark</span>
</button>
<div class="page">
<a class="back" href="index.html">← back</a>
<div class="resume-name">taxi-search</div>
<div class="resume-contact">
<a href="https://github.com/daverlon/taxi-search" target="_blank">
github.com/daverlon/taxi-search
</a>
</div>
<div class="meta">
Python · Graph Search · AI Planning · Taxi-v3 (Gymnasium)
</div>
<div class="section-heading">Overview</div>
<div class="text-block">
taxi-search is an AI search framework that implements and compares classical graph search
algorithms in the Taxi-v3 environment from Gymnasium.
</div>
<div class="image-center">
<img src="img/taxisearch_preview.png" width="300">
</div>
<div class="text-block">
The project focuses on building a fully self-contained state representation and search system
that can solve the environment without relying on Gym’s internal transition logic during search.
</div>
<div class="section-heading">Algorithms Implemented</div>
<ul>
<li>Depth-First Search (DFS)</li>
<li>Breadth-First Search (BFS)</li>
<li>Uniform Cost Search (UCS)</li>
<li>A* Search (with Manhattan-distance heuristic)</li>
</ul>
<div class="section-heading">Core Design</div>
<ul>
<li>Custom state encoding/decoding of Taxi-v3 environment</li>
<li>State represented as a 4-element vector (taxi, passenger, destination, location)</li>
<li>Explicit transition system via a custom TaxiPuzzle class</li>
<li>Action masking implemented independently of Gymnasium</li>
<li>Search tree built via node expansion rather than environment stepping</li>
</ul>
<div class="section-heading">A* Heuristic</div>
<ul>
<li>Manhattan distance to passenger when not picked up</li>
<li>Manhattan distance to destination after pickup</li>
<li>Two-phase goal structure (pickup → drop-off)</li>
</ul>
<div class="section-heading">Key Engineering Decisions</div>
<ul>
<li>Decoupled search logic from Gymnasium for full control and reproducibility</li>
<li>Explicit node-based search tree (parent/child structure)</li>
<li>Priority queue ordering for optimal-path selection</li>
<li>Uniform cost interpretation of reward (-1 step, +20 delivery, -10 penalty)</li>
</ul>
<div class="section-heading">Performance Analysis</div>
<ul>
<li>Evaluated across 500 random environments</li>
<li>Metrics: search time, expansions, frontier size, final reward</li>
<li>A* and UCS consistently found optimal solutions</li>
<li>DFS produced faster but non-optimal solutions</li>
</ul>
<div class="section-heading">Key Results (Summary)</div>
<ul>
<li>A*, UCS, BFS: optimal reward (~7.69 average)</li>
<li>DFS: faster but suboptimal (~0.82 average reward)</li>
<li>A* significantly reduced node expansions vs BFS/UCS</li>
<li>BFS had highest frontier size and memory cost</li>
</ul>
<div class="section-heading">Limitations</div>
<ul>
<li>Fully decoupled from Gym environment (manual simulation required)</li>
<li>No dynamic environment stepping during search</li>
<li>Action mask implemented manually (no runtime env queries)</li>
<li>Limited to Taxi-v3 state space structure</li>
</ul>
<div class="section-heading">What I Learned</div>
<ul>
<li>Graph search behaviour differences in practice (DFS vs BFS vs UCS vs A*)</li>
<li>Trade-offs between optimality and computational cost</li>
<li>Designing state machines independent of simulation environments</li>
<li>Impact of heuristics on search efficiency</li>
</ul>
</div>
<script>
const btn = document.getElementById('theme-toggle');
const label = document.getElementById('toggle-label');
if (document.documentElement.classList.contains("dark")) {
label.textContent = "light";
}
btn.addEventListener('click', () => {
const isDark = document.documentElement.classList.toggle('dark');
localStorage.setItem("theme", isDark ? "dark" : "light");
label.textContent = isDark ? "light" : "dark";
});
</script>
</body>
</html>