Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CS 380 Assignment 1: Solving 8-puzzle using Uninformed Search Algorithms, Assignments of Computer Science

An assignment for a university course, cs 380, in the fall of 2006. Students are required to write code to solve an 8-puzzle using uninformed search algorithms, specifically bfs, dfs, and dls. The assignment includes exercises to calculate the average branching factor and the average number of moves required to solve an 8-puzzle. Students must also write a report comparing the efficiency of the three algorithms.

Typology: Assignments

Pre 2010

Uploaded on 08/19/2009

koofers-user-d49
koofers-user-d49 🇺🇸

10 documents

1 / 2

Toggle sidebar

Related documents


Partial preview of the text

Download CS 380 Assignment 1: Solving 8-puzzle using Uninformed Search Algorithms and more Assignments Computer Science in PDF only on Docsity! CS 380: Assignment 1 Fall 2006 Written Due before class on 2006-10-06. From R&N Chapters 2 & 3: Exercises 2.2, 2.6, 3.7 What is the average branching factor of 8-puzzle1? Extra Credit: What is the average number of “slides” required to solve an 8-puzzle? Please show all work. Programming Due before class on 2006-10-13. You will be implementing a solver for the 8-puzzle game. You will use uninformed search and must implement BFS, DFS, and DLS. Once you have implemented all three search techniques, create a short report (just a paragraph or two) comparing their efficiency. To be statistically sound, this will require running each algorithm a number of times over randomly-generated 8-puzzle instances. Either as a part of this report or a separate README should be instructions for running/testing your code. The game logic has been implemented in 8puzzle.lisp (available on the course website); you may choose to use this file as a starting point. All work must be done in Lisp and be executable in clisp. You should ultimately end up with a function called something like “solve-8puzzle” that, given an initial 8-puzzle instance will return a list of the moves required to get to the goal state. For example: [1]> (load "8puzzle.lisp") ;; Loading file 8puzzle.lisp ... ;; Loaded file 8puzzle.lisp T [2]> (let ((puzzle (random-puzzle))) (print-puzzle puzzle) (solve-8puzzle ’BFS puzzle)) ------------- | 1 | 6 | 2 | ------------- | 4 | | 3 | ------------- | 7 | 5 | 8 | ------------- (UP RIGHT DOWN LEFT DOWN RIGHT) Here are some hints/guidelines: • Implement the General-Search algorithm described in R&N (this means you’ll need the functions Make-Queue, Empty?, et cetera). 1For a description of 8-puzzle see http://en.wikipedia.org/wiki/N-puzzle 1
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved