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

Assignment - Haaff elementary school lunch menu - Convert +610 to binary using the excess_127 system. - Susan beal hypothesized that _____ played a role in sids deaths. - Which statement best captures the importance of good personal hygiene - Title servant in a 1946 goddard film crossword - Aluminium tubular busbar current rating - Types of seams ppt - Arrange the following compounds in order of increasing acidity - By the waters of babylon setting - Political - Multiple schedule of reinforcement - Human rights lesson plan - Global marketing warren j keegan pdf - Solidworks volume of part - Purchase order approval process flowchart - Cost accounting chapter 6 homework solutions - Tina jones neurological shadow health - Here is the assignment due 24 hours - BA 2010 - Catalinbread karma suture manual - Kpi for industrial relations manager - Official academic transcript uq - A view from the bridge cherokee paul mcdonald - Aviation crimes - COMM THEORY - ATTRIBUTION THEORY/CRISIS/COVID - Ctopp-2 sample report ages 7-24 - Undistributed corporate profits are called - 144 dryandra street o'connor act 2602 - Description of a park in winter - Obama nobel peace prize speech analysis - Personal responsibility paper - The 5 process groups of project management - Difference between test-retest and intra-rater reliability - West trenton train station - ME - Main - Dis 2 - Week 8 - Midwest punch au gres mi - Does yossarian die in catch 22 - I need a response to these 2 discussion done for week 2 for my Recruit, Assess, Develop, and Retain Class - How does hipaa affect medical assistants - Question 5 - Molly in private peaceful - Soap note template for nurse practitioners - 2 replies - Toys r us narre warren - Grammar check and rewrite - Health Care Literacy Presentation - +971561686603 Abortion pills in Dubai/Abu Dhabi-mifepristone & misoprostol in DUBAI - Burning iron wool equation - Final Project Annotated Bibliography - Career development interventions 5th edition apa citation - Conversational techniques in english - Cu h20 6 2 - A school field trip essay - Henkel thermal interface material - An insurance company offers four different deductible levels - Closest tnt local exchange - What is it about 20 somethings essay - How does a colourimeter work - Why doesn't sand dissolve in water - Ethical and Lega; Aspects of Nursing Practice DQ 1 week 1 - Find highest and lowest of five integers using java loops - Identify the phases of relationship deterioration - Respond to 2 Colleagues 1 paragraph each - Ecotourism discussion questions - Can kookaburras eat cane toads - Engineering - Comparing Research Reports - Symon brewis-weston net worth - Gen Biology - Assignment #1A and 1B - The pedestrian theme essay - Strategy and the internet porter - Reheapdown - Understanding and managing diversity pdf - Michael dillon pharmacy 777 - Section 106 consultation letter - Two methods for evaluating evidence - How to calculate forecast bias in excel - Heparin drip calculation practice problems - 112 shields bldg university park pa 16802 - Out of the easy quotes - Multicultural health ritter - What does bt37 mean - Classdojo com parent login - Was roy lichtenstein marriedwas roy lichtenstein married - Community Health - Dreams come true michelangelo & jasmin cruz lyrics - Test your understanding questions - What are the measures of variation - Fundamentals and applications of ultrasonic waves - Effects of alcohol on heart rate of daphnia magna - Underline the collective nouns - Hillhead high school teachers - What event prompted gina's first symptoms of bipolar disorder - Rite aid pharmacy mission statement - My virtual teen - Unit 7 Discussion 2 - Is cockapoo a recognized breed - Cambridge resources for the ib diploma economics