Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

Missionaries and cannibals python dfs

23/11/2021 Client: muhammad11 Deadline: 2 Day

Artificial Intelligence Hw

Introduction

This assignment begins a series of three assignments the cover state-space search in depth. We start by introducing a framework for the classical theory of problem solving. This will prepare the way to study the use of heuristics for state-space search in Assignment 3. Note that this assignment is an "individual work" assignment, and should not be done in partnerships or groups.

Procedure

1. Begin this assignment by reading the 1st chapter of "Applying AI in Problem Solving" (linked from the Readings page).

2. Next, download the starter code for this assignment. Un-tar it using a standard file archiving tool such as tar, WinZip, Windows Compressed Folders, etc.

3. Examine each of the two problem formulation files provided. One is the Missionaries and Cannibals problem. The other is the Towers of Hanoi problem. An additional file is provided, Farmer_Fox.py, and you will be writing one new problem formulation in that file.

In the given formulation files, pay particular attention to how the State class is defined and how the operators are established. We will be talking about this code in class.

4. An interactive solving client is provided. This is implemented in the file Int_Solv_Client.py. Optional but recommended: Try running the client with Towers of Hanoi by using the following command in a Linux, Darwin, or Cygwin command shell. To do this, issue the command:

python3 Int_Solv_Client.py TowersOfHanoi 3

If you are not comfortable working in Linux, Darwin, or Cygwin, you may wish to simply create a working folder with the Interactive Solving Client in it, and all the problem formulation files in it, and edit the importing code of the Interactive Solving Client so that it simply imports the problem formulation of your choice, and then run the program from IDLE, PyCharm, or other IDE you might be using.

5. Create your own problem formulation for the "Farmer, Fox, Chicken, and Grain" problem covered in class. Then do either option 5a or 5b below to produce a session transcript for your formulation. Option 5a: Using the interactive solving client, demonstrate the use of your formulation to create a solving-session log. You can simply capture your screen to show the log. If you capture the screen as a text file, name the file FFCG-log.txt, If you capture it as an image, name the file FFCG-log.jpg, FFCG-log.png, or FFCG-log.gif, depending on the image file format. Option 5b: Use the starter-code program ItrDFS.py (described in item 6 below) to create output with your formulation. Capture that output and name the file as in option 5a.

6. Starting with the starter-code file ItrDFS.py, which implements a loop-based depth-first search method ("DFS" in the following), implement BFS (Breadth-First Search) as it is specified in the lecture slides. Make sure that these implementations keep track of "predecessor" links (also known as back links), and they can report a shortest path from start to goal, for whatever problem they are applied to. (You can implement these links using a hash table, i.e., dictionary, that maps each state other than the initial state to its parent state. The initial state should be mapped to a special value such as None, or -1, which is up to you.)

7. Compare DFS and BFS on the following problems: (i) Missionaries and Cannibals, (ii) Farmer, Fox, Chicken, and Grain, and (iii) 4-Disk Towers of Hanoi. For each combination of algorithm and problem, report the following: (a) the path found from start to goal, (b) the length of the path, (c) the number of nodes expanded (i.e., removed from OPEN and had successors generated). Create a file BlindSearches.pdf that contains a table showing these results in a clear, easy-to-read manner. Your Towers-of-Hanoi paths can be shown outside the table, since they can be relatively long. This file can be created with Microsoft Word, Google Docs, or similar tool.

8. Starting with the starter-code file starter-file-for-UCS.py, implement the Uniform-Cost Search algorithm. The starter file provides you with an implementation of a special kind of priority queue which supports not only the standard insert and delete_min operations, but also a method called contains, which returns True if a given element is in the priority queue. It also allows accessing and updating the priority value of any element in the priority queue. See the documentation for more information. This priority queue is not just adequate for implementing Uniform-Cost Search, but will be particularly helpful in Assignment 3, when it is time to implement the A* Search algorithm. The main difference between Breadth-First Search and Uniform-Cost Search (UCS) is that UCS works with problem formulations that have different costs associated with different moves. In terms of graph search, there are edge costs, and they are not necessarily assumed to be all equal to 1 as they essentially are in Breadth-First Search. The starter code includes a new problem formulation for you to use with UCS; it's the French Cities network in which the problem is to find a shortest route from the initial-state city to the goal-state city. These are, by default, RENNES and AVIGNON. (These could easily be changed by editing the formulation file's line defining STARTING_CITY, etc.) This formulation is in the file FranceWithCosts.py. The State class in this formulation file has a method edge_distance(s2), which is used to get the edge cost from the current state to s2. You'll be setting up your UCS.py program to use these cost values to determine the cost of the lowest-cost path from the starting state to any newly reached state. When your UCS algorithm reaches a goal state, it should do a backtrace of "backlinks" (sometimes called predecessor links) to determine the actual lowest-cost path from the start state to the goal state found. The file starting-file-for-UCS.py includes a method runUCS. The staff is planning to use an autograder that imports your file and calls this function. It will then be able to check the value of the variable SOLUTION_PATH to determine whether your implementation is finding correct answers. For the default initial state and goal state, the results should be

['Rennes', 'Nantes', 'Limoges', 'Lyon', 'Avignon']

for the SOLUTION_PATH variable and

1041.0

for the TOTAL_COST variable. The autograder may also change the initial state and goal state by modifying certain methods of the problem formulation. Thus, your program should be able to find a shortest path for any pair of cities in the given network. Although there is a Python implementation of Uniform-Cost Search inthe reading, your implementation for this assignment will be different. The code you write will need to fit in with the starter code provided in the file starter-file-for-UCS.py. This implementation will then be compatible with the problem formulation files we use in the course, and it will be a very helpful stepping stone to the implementation of A* Search, which you'll get to do in Assignment 3.

Keep in Mind

Here are some ideas to keep in mind for this assignment. The problem format we are using not only permits the "manual solving" that you do with the Interactive Solving Client. It also permits automatic solving, such as with DFS, and BFS. Thus it is important that you follow the problem structure correctly. Certain methods are required in the State class, including __init__, __eq__, __hash__, __str__, and copy. The operators must have the correct structure, as well. The nice thing about the Interactive Solving Client is that it provides a pretty good means to test whether your formulation will be OK.

Even if you are familiar with Python, there may be some constructs in the formulation files that you are not familiar with. You can read up on list comprehensions (p.31 of the first reading) and lambda expressions (pp. 47-52 of that reading). We'll also cover them in class.

What to Turn In

Turn in five files, but NOT zipped up, because that will interfere with the grading workflow. (As an incentive for compliance, the staff will deduct 2 points if the files are zipped.) The five files are the following: (a) Farmer_Fox.py, (b) FFCG-log.txt, or FFCG-log.jpg, or FFCG-log.png, or FFCG-log.gif, (c) BFS.py, (d) BlindSearches.pdf and (e) UCS.py

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

Helping Engineer
Homework Guru
Financial Hub
A+GRADE HELPER
Best Coursework Help
Professional Accountant
Writer Writer Name Offer Chat
Helping Engineer

ONLINE

Helping Engineer

This project is my strength and I can fulfill your requirements properly within your given deadline. I always give plagiarism-free work to my clients at very competitive prices.

$40 Chat With Writer
Homework Guru

ONLINE

Homework Guru

I have worked on wide variety of research papers including; Analytical research paper, Argumentative research paper, Interpretative research, experimental research etc.

$15 Chat With Writer
Financial Hub

ONLINE

Financial Hub

This project is my strength and I can fulfill your requirements properly within your given deadline. I always give plagiarism-free work to my clients at very competitive prices.

$42 Chat With Writer
A+GRADE HELPER

ONLINE

A+GRADE HELPER

I have read your project details and I can provide you QUALITY WORK within your given timeline and budget.

$16 Chat With Writer
Best Coursework Help

ONLINE

Best Coursework Help

As per my knowledge I can assist you in writing a perfect Planning, Marketing Research, Business Pitches, Business Proposals, Business Feasibility Reports and Content within your given deadline and budget.

$23 Chat With Writer
Professional Accountant

ONLINE

Professional Accountant

I am an elite class writer with more than 6 years of experience as an academic writer. I will provide you the 100 percent original and plagiarism-free content.

$30 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

Mcgraw hill connect economics chapter 7 answers - Internal architecture of 8051 microcontroller - Red bull case study answers - Assignment - Rough Draft - The dark side of chocolate questions answers - Michael minikes net worth - Discussion - Gibbs reflective cycle occupational therapy - Download 100 tambola tickets free - Course Assignment 2 - Security guidance for critical areas of focus in cloud computing - Navajos wear nikes chapter summaries - Research at least three GIS systems - Pareto quote - The words under god in the pledge of allegiance - Review l oreal brand portfolio - Module 01 Discussion - Conflicts of Actuarial Fairness - Macbeth act 2 discussion questions answers - HRM 300 Week 1-5 Discussions Questions - Internal environment factors in strategic management - Philosophy - Gladys corner shoes adelaide - IV, infusion - University of bath campus map - 2 student responses - Determination of equilibrium constant for an esterification reaction lab report - National textile university faisalabad fee structure - Pienso comprar aquellas camisas verdes - Debut emcee script introduction - How to check bridge rectifier - Business Plan - Tenet group iit madras - A separate peace questions - How to write twenty three hundredths - The unfinished nation volume 2 8th edition pdf - Theology Paper - Discussion - Analyze the role of language processing in cognitive psychology - Chcece001 develop cultural competence answers - How to make activity relationship diagram - Types of ict systems - Brune medical centre gosport - At a certain age poem - Ironport messaging gateway appliance - Sw023 ah whm 010 - Monet painting in his studio boat - 5e lesson plan on ecosystems - Emergency planning team - Political cartoon analysis essay - The wounded knee massacre answer key - Theodore roosevelt hyphenated american speech - Vcat vic gov au renting notice - Here are four industries and four forecasts for the macroeconomy - How to reset thermo king codes - Kingsgrove bus depot lost property - Dead poets society standing on desk scene - Beneath the surface gary crew online book - Outline for Assignment 2 - Cie chemistry data booklet - Vice our rising oceans - Business - What is dual discrimination - Negative Effects of TV in Children - Is it ever ok to break a promise pdf - 5 skill related fitness components - Project management exam essay questions and answers pdf - Cisco switch stack current state removed - Jac and jack glasses - Susan moylan coombs biography - Why we crave horror movies essay - Long term residential Care week 2 - Super size me movie questions and answers - Heat of reaction lab report introduction - Database - 3 types of interdependence - Dpmap performance elements and standards examples - Leaving cert physics experiments - Why did ken kutaragi invent the playstation - Dissent from secondary use of patient identifiable data - Australian journal of basic and applied sciences - Clarkson valves canada - Financial accounting Problem, kindly bid only if you have financial accounting experience to save your time - Dsc neo module tamper alternate comm - The cell laboratory report 3 - Exercise 30 blood vessel identification answers - Windermere manor hotel london ontario canada - What plus oxygen equals carbon dioxide - Mass effect 3 grissom academy support or battle - SOA and micro services - Spss descriptive statistics by gender - Tina jones musculoskeletal subjective data - Independent strategy of an organization to change its current environment - Paulton junior school website - Hot fitness trends - Russian TV - How to compute double declining balance depreciation - +91-8306951337 kala jadu specialist astrologer IN Davanagere - Maximum and minimum temperature of uranus - Arabic to english translation in riyadh