summaryrefslogtreecommitdiffstats
path: root/test_cases/q4/astar_1_graph_heuristic.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/q4/astar_1_graph_heuristic.test
initial commit
Diffstat (limited to 'test_cases/q4/astar_1_graph_heuristic.test')
-rw-r--r--test_cases/q4/astar_1_graph_heuristic.test54
1 files changed, 54 insertions, 0 deletions
diff --git a/test_cases/q4/astar_1_graph_heuristic.test b/test_cases/q4/astar_1_graph_heuristic.test
new file mode 100644
index 0000000..b5afd79
--- /dev/null
+++ b/test_cases/q4/astar_1_graph_heuristic.test
@@ -0,0 +1,54 @@
+class: "GraphSearchTest"
+algorithm: "aStarSearch"
+
+diagram: """
+ 2 3 2
+ S --- A --- C ---> G
+ | \ / ^
+3 | \ 5 / 1 /
+ | \ / /
+ B --- D -------/
+ 4 5
+
+S is the start state, G is the goal. Arrows mark possible state
+transitions. The number next to the arrow is the cost of that transition.
+
+The heuristic value of each state is:
+ S 6.0
+ A 2.5
+ B 5.25
+ C 1.125
+ D 1.0625
+ G 0
+"""
+# 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: S
+goal_states: G
+S 0 A 2.0
+S 1 B 3.0
+S 2 D 5.0
+A 0 C 3.0
+A 1 S 2.0
+B 0 D 4.0
+B 1 S 3.0
+C 0 A 3.0
+C 1 D 1.0
+C 2 G 2.0
+D 0 B 4.0
+D 1 C 1.0
+D 2 G 5.0
+D 3 S 5.0
+"""
+heuristic: """
+S 6.0
+A 2.5
+B 5.25
+C 1.125
+D 1.0625
+G 0
+"""