Project 1
Disclaimer
Please DO NOT distribute project material or solutions online (e.g. public GitHub repositories). We take violations of the honor code very seriously.
Overview
For this assignment, you will implement depth-first search and breadth-first search in project_pathplan/graph_search.js
.
Instructions
- Environment Setup
- Download kineval-stencil and unzip it.
- Open a terminal and execute
python -m http.server
in the root directory of the project to start an http server. - Open a browser and go to
http://localhost:8000/project_pathplan/search_canvas.html
. - Open the developer tools console (Ctrl+Shift+J in Chrome) to probe variables like
search_alg
,q_start_config
,q_goal_config
, orsearch_iter_count
.
Depth-first Search and Breadth-first Search
- Implement the search algorithms in
project_pathplan/graph_search.js
. initSearchGraph()
initializes the search graphG
- Add code under
// STENCIL: determine whether this graph node should be the start...
- Add code under
iterateGraphSearch()
performs 1 iteration of the search algorithm.- Add code under
// STENCIL: implement a single iteration of a graph search algorithm...
- If
search_alg=="depth-first"
, execute depth-first search, ifsearch_alg=="breadth-first"
, execute breadth-first search. - Return
"succeeded"
if the search algorithm has found a path from the start to the goal,"failed"
if the search algorithm has determined that no path exists, and"iterating"
if the search algorithm is still searching. - Use helper functions
testCollision()
,drawHighlightedPathGraph()
, anddraw_2D_configuration()
defined inproject_pathplan/infrastructure.js
andproject_pathplan/draw.js
to navigate and visualize the graph appropriately. - Make sure you add nodes in E, W, S, N order to match the video and pass the autograder.
- Make sure you set
search_iterate=false
after the search algorithm has finished.
- Add code under
- You only need to implement depth-first search and breadth-first search (not A-star, greedy best-first search, or min heap).
- To execute, open a browser and go to
http://localhost:8000/project_pathplan/search_canvas.html?search_alg=depth-first?planning_scene=narrow1
- To execute breadth-first search, replace
depth-first
withbreadth-first
.
- To execute other environments, replace
narrow1
withempty
,misc
,narrow2
, orthree_sections
- More details on parameters can be found in
initSearch()
inside `project_pathplan/infrastructure.js
- To execute breadth-first search, replace
- Implement the search algorithms in
- Submit your
project_pathplan/graph_search.js
- The autograder is available at https://cse-ag-csci5551.cse.umn.edu/
Deadline
This project is due on Wednesday, January 31st at 11:59pm CT.
Grading
The project is worth a total of 10 points.