summaryrefslogtreecommitdiffstats
path: root/test_cases/q2/graph_bfs_vs_dfs.test
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2021-08-31 13:16:22 -0500
committerToby Vincent <tobyv13@gmail.com>2021-08-31 13:16:22 -0500
commitaf648f856bb1517449e4bae86b7e7f4e326c2268 (patch)
treec4313d2ce17462b4fd4987e1103172614c5387fe /test_cases/q2/graph_bfs_vs_dfs.test
initial commit
Diffstat (limited to 'test_cases/q2/graph_bfs_vs_dfs.test')
-rw-r--r--test_cases/q2/graph_bfs_vs_dfs.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/test_cases/q2/graph_bfs_vs_dfs.test b/test_cases/q2/graph_bfs_vs_dfs.test
new file mode 100644
index 0000000..47b78a6
--- /dev/null
+++ b/test_cases/q2/graph_bfs_vs_dfs.test
@@ -0,0 +1,30 @@
+# Graph where BFS finds the optimal solution but DFS does not
+class: "GraphSearchTest"
+algorithm: "breadthFirstSearch"
+
+diagram: """
+/-- B
+| ^
+| |
+| *A -->[G]
+| | ^
+| V |
+\-->D ----/
+
+A is the start state, G is the goal. Arrows
+mark possible transitions
+"""
+# The following section specifies the search problem and the solution.
+# The graph is specified by first the set of start states, followed by
+# the set of goal states, and lastly by the state transitions which are
+# of the form:
+# <start state> <actions> <end state> <cost>
+graph: """
+start_state: A
+goal_states: G
+A 0:A->B B 1.0
+A 1:A->G G 2.0
+A 2:A->D D 4.0
+B 0:B->D D 8.0
+D 0:D->G G 16.0
+"""