首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
program代做、代写Python程序语言
项目预算:
开发周期:
发布时间:
要求地区:
Figure.1 A simple example of 8 puzzle
Project Description
An 8 puzzle is a simple game consisting of a 3 x 3 grid (containing 9 squares). One of the squares is
empty. The remaining 8 squares in the grid have a movable tile that is annotated with a digit ranging
from 1-8 (hence, the name 8 puzzle). The objective in solving 8-puzzle is to keep moving the tiles around
into different positions one by one (so you move one tile at a time, and then you think about your next
move) until the numbers on the 3x3 satisfy a "goal test". In this project, we are going to experiment with
more than one kind of goal test.
Files to Submit: As part of the project submission, we expect you to submit a zip file which contains only
three files. You will need to create and submit 2 files for the assignment by yourselves (See Table 1 below
for file name and explanation). Make sure that you name these files exactly like this.
File Name Explanation
File-1: solution_q1.py Include all functions that could generate answers
for each sub-problem of Q1. Include solutions to
all the problems in a single Python file. Make sure
that your solution file could be directly run in the
terminal (through the command line “python
solution_q1.py”)
File-2: solution_q2.py Include all functions that could generate answers
for each sub-problem of Q2. Include solutions to
all the problems in a single Python file. Make sure
DS/CMPSC 442: Artificial Intelligence
Fall 2023
Project-1 Solve the game of 8-puzzle
!"#$% &$' ()+, -(%(. /01
In this project, every student is required to implement search algorithms learned during the class using
Python 3.9 (this is important, make sure that your code compiles with Python 3.9) to solve the 8-puzzle
problem under different scenarios. The detail of each question is mentioned below.
that your solution file could be directly run in the
terminal (through the command line “python
solution_q2.py”)
File-3: proj-1-submission.pdf Answer the rest of the questions in this project
Table 1. Submission files for project-1
In solution.py, you should have the ability to read from a file named “input.txt” (includes initial state of 8
puzzle) and print out the corresponding solutions in the terminal. In “input.txt” (make sure that you use
the same file name), you should have a single line that specifies the starting state of the 8-puzzle
problem. As an example, take the initial state in Figure.1 as an example, the input.txt file should contain
a single line that looks like this (The symbol ”_” represents the empty square):
7,2,4,5,_,6,8,3,1
As another example, if the initial state that you wanted to specify was the right-hand side state shown in
Figure 1, then input.txt should look like this.
_,1,2,3,4,5,6,7,8
NOTE: Make sure that there is no whitespace in your input.txt, so no space or tab characters in
between the numbers. Only use a single comma without any whitespaces to delimit the different
numbers in your file.
And the expected output inside the Terminal is (In the expected output window below, the phrase
“#answer generated by your function.” is a coding style comment. We don’t expect that to be part of the
output):
The solution of Q1.1 is:
#answer generated by your function.
The solution of Q1.2 is:
#answer generated by your function.
The solution of Q1.3 is:
#answer generated by your function.
……
…
…
Figure.2 The expected output in the terminal when running “python solution_q1.py”
Evaluation: Your code will be graded manually by TA for technical correctness. To foster the grading
process, they will directly check the output printed in the terminal after running the command “python
solution.py” with different testing version of “input.py” that the instructor has created. So make sure your
code can run in the terminal smoothly before making the submission.
Academic Dishonesty: We will be checking your code against other submissions in the class for logical
redundancy (using automated software). If you copy someone else’s code and submit it with minor
changes, we will know. These cheat detectors are quite hard to fool, so please don’t try. We trust you all
to submit your own work only; please don’t let us down. If you do, we will pursue the strongest
consequences available to us.
Now, let’s get down to the fun part and let’s code up some search algorithms ☺ ☺ ☺
Question-1 Find the solution of 8-puzzle
For question 1, our goal test is the following: “all numbers should be arranged in
increasing order on the 3x3 grid and the empty cell should be on the top left corner”
(HINT: this is exactly the goal test that we have talked about in class, and this goal
state can also be seen on the right side of Figure 1 above)
Q1.1 The Coding Component
Q1.1.a
Implement a DFS that can work with an “input.txt” file that contains any possible starting state. Please
notice that the output of this implementation should be the actual path returned. Submit your code into
File-1(solution_q1.py).
Q1.1.b
Implement a BFS that can work with an “input.txt” file that contains any possible starting state. Please
notice that the output of this implementation should be the actual path returned. Submit your code into
File-1(solution_q1.py).
Q1.1.c
Implement a UCS that can work with an “input.txt” file that contains any possible starting state. Assume
that each tile movement requires paying a cost of 1 unit. Please notice that the output of this
implementation should be the actual path returned. Submit your code into File-1(solution_q1.py).
Q1.1.d
Implement A* search that can work with an “input.txt” file that contains any possible starting state. For
the choice of your heuristic function, use the Manhattan distance heuristic (this can be found in Slide 64
of the A* slide deck that was covered in class). Submit your code into File-1(solution_q1.py). Please notice
that the output of this implementation should be the actual path returned.
Q1.1.e
Implement A* search that can work with an “input.txt” file that contains any possible starting state. For
the choice of your heuristic function, use the Straight Line Distance heuristic which calculates the straight
line distance between the source tile and the destination tile, and adds this distance across each tile on
the 3x3 grid (we covered this heuristic in class). Submit your code into File-1(solution_q1.py). Please notice
that the output of this implementation should be the actual path returned.
Q1.2 The Writing Component
For all parts to this question, use the following starting state of the 8-puzzle search problem:
7,4,_,1,2,5,8,3,6
Q1.2.a
For your DFS implementation in Q1.1.a, run it with the start state given above, and tell us how many node
expansions of the search tree did DFS do to find the solution? Write down the answer to this question
into file-3 (proj-1-submission.pdf).
Q1.2.b
For your BFS implementation in Q1.1.b, run it with the start state given above, and tell us how many node
expansions of the search tree did BFS do to find the solution? Write down the answer to this question
into file-3 (proj-1-submission.pdf).
Q1.2.c
For your UCS implementation in Q1.1.c, run it with the start state given above, and tell us how many node
expansions of the search tree did UCS do to find the solution? Write down the answer to this question
into file-3 (proj-1-submission.pdf). Note: Assume that each tile movement requires paying a cost of 1
unit.
Q1.2.d
For your A* implementation in Q1.1.d, run it with the start state given above, and tell us how many node
expansions of the search tree did A* search do to find the solution? Write down the answer to this
question into file-3 (proj-1-submission.pdf).
Q1.2.e
For your A* implementation in Q1.1.e, run it with the start state given above, and tell us how many node
expansions of the search tree did A* search do to find the solution? Write down the answer to this
question into file-3 (proj-1-submission.pdf).
Questions-2 Find the solution of modified 8-puzzle
We now want to solve a different search problem. For question 2, our goal test is the
following: “the sum of numbers in the top row of the 8-puzzle should sum up to 11. If
that is true, we have reached a goal state”.
Q2.1 The Coding Component
Q2.1.a
Modify your DFS implementation to handle the new goal test. Submit your code into File2(solution_q2.py). Please notice that the output of this implementation should be the actual path returned.
Q2.1.b
Modify your BFS implementation to handle the new goal test. Submit your code into File2(solution_q2.py). Please notice that the output of this implementation should be the actual path returned.
Q2.1.c
Modify your UCS implementation to handle the new goal test. Assume that each tile movement requires
paying a cost of 1 unit. Submit your code into File-2(solution_q2.py). Please notice that the output of this
implementation should be the actual path returned.
Q2.1.d
Modify your A* implementation to handle the new goal test. For the choice of your heuristic function, use
the Manhattan distance heuristic (this can be found in Slide 64 of the A* slide deck that was covered in
class). Submit your code into File-2(solution_q2.py). Please notice that the output of this implementation
should be the actual path returned.
Q2.1.e
Modify your A* implementation to handle the new goal test. For the choice of your heuristic function, use
the Straight Line Distance heuristic which calculates the straight line distance between the source tile and
the destination tile, and adds this distance across each tile on the 3x3 grid (we covered this heuristic in
class). Submit your code into File-2(solution_q2.py). Please notice that the output of this implementation
should be the actual path returned.
Q2.2 The Writing Component
For all parts to this question, use the following starting state of the 8-puzzle search problem:
8,1,4,5,2,6,3,7,_
Q2.2.a
For your DFS implementation in Q2.1.a, run it with the start state given above, and tell us how many node
expansions of the search tree did DFS do to find the solution? Write down the answer to this question
into file-3 (proj-1-submission.pdf).
Q2.2.b
For your BFS implementation in Q2.1.b, run it with the start state given above, and tell us how many node
expansions of the search tree did BFS do to find the solution? Write down the answer to this question
into file-3 (proj-1-submission.pdf).
Q2.2.c
For your UCS implementation in Q2.1.c, run it with the start state given above, and tell us how many node
expansions of the search tree did UCS do to find the solution? Write down the answer to this question
into file-3 (proj-1-submission.pdf). Note: Assume that each tile movement requires paying a cost of 1
unit.
Q2.2.d
For your A* implementation in Q2.1.d, run it with the start state given above, and tell us how many node
expansions of the search tree did A* search do to find the solution? Write down the answer to this
question into file-3 (proj-1-submission.pdf).
Q2.2.e
For your A* implementation in Q2.1.e, run it with the start state given above, and tell us how many node
expansions of the search tree did A* search do to find the solution? Write down the answer to this
question into file-3 (proj-1-submission.pdf).
---------------------------------------END OF PROJECT----------------------------------
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代写 gr5280、代做 java/pytho...
2024-12-22
代写 data 编程、代做 python ...
2024-12-22
chc5049 代做、代写 sql 编程设...
2024-12-22
comp1038 代写、c++编程设计代...
2024-12-22
chc5028代做、代写c/c++设计编...
2024-12-21
代做program、代写sql程序设计
2024-12-21
itc228编程代写、代做java程序...
2024-12-21
代写comp 330 (fall 2024): as...
2024-12-21
代写busi2105 quantitative me...
2024-12-21
代做7ssgn110 environmental d...
2024-12-21
代做busi2105 quantitative me...
2024-12-21
代写csc 110 y1f fall 2024 qu...
2024-12-21
代做management accounting au...
2024-12-21
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!