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

Functions of international financial market - Cutlip center & broom 2006 - Examples of perceptual filters - Why is protein the last resort for energy - Economic - North baddesley health centre - Georgia tech chemical engineering curriculum - Argument - Research paper - Www livetheorangelife com annual enrollment - Stoichiometry of a precipitation reaction labpaq answers - Operations management william j stevenson pdf - Centor bifold hinge adjustment - Bcos marketing - Baxter dental and medical - Xbar and r chart template - Which conditions are best served by proper breathing exercises - Ethical and Lega; Aspects of Nursing Practice DQ # 11 week 7 VIVian Guilen - Case study on od interventions - Three paradigms of nursing human needs interactive and unitary process - Singapore airlines customer service innovation case study analysis - Harvard referencing western sydney - Hw 5 pt1 - Qualitative and a quantitative clinical question - Red river college fees - Discussion - Independent variable in benedict's test - Ebscohost liberty university - School leadership series study guide - Gattaca movie questions biology - HWP Page 23: 1-32 thru 1-34 - Lloyd ackert drexel - In the planning stage analytical procedures are used to - 344 coatesville riverhead highway - What were two causes of the great depression - Roller coaster graph equations - Lewis dot diagram for carbon dioxide - Oxford big ideas humanities 8 publisher - Maria de jesus brazil 1964 - Social science principles snhu - Tweak growing up on summary - Exam 70 768 practice test - Quick write - Strategy and structure have a reciprocal relationship - Susan komen planned parenthood 2018 - A theoretical orientation is best described as: - Organizational communication a critical approach pdf - Access grader project chapter 3 - Target version of proactiv - How to make the best out of a bad situation - Morrisons swan valley northampton phone number - Affective objectives for physical education - Is a mole a herbivore carnivore or omnivore - Pallet storage cost per week sydney - Fast food restaurant organizational chart - University of brighton moulsecoomb - English is a crazy language lederer - Why do mergers and acquisitions sometimes fail to produce anticipated results? - Https lc grad2 gcu edu learningplatform user login html - Library thinkquest org 19537 - Greenwood conference centre irvine - Eagle one wheel cleaner autozone - Critical thinking exercise 3 - Short story using anatomy terms - Interactionist perspective on sports - Building Products Inc. Alternative working schedule - Eisp policy - Art - Complex numbers in electrical circuits - Certified risk and compliance management professional crcmp exam - Ethics in criminal justice - El pastor linda ronstadt - Advantages of a naturalistic observation - Flexpath strategies scam - The beatles ludwig bop bass drum head lamp display - Abbott point of care clew update - Dq - The honourable wally norman - Theme from the giver - Cast coil vs dry type transformer - ODC 3 - Single acting pneumatic cylinder symbol - Following are transactions of danica company - Discussion Board - Michael levin the case for torture - Discussion - La haine character descriptions - Cnc machine bed design - Define educational depth and weight - Www authentichappiness sas upenn edu - Organisational behaviour pdf free download - Kk7b micro r2 receiver - Dimensions of brick in mm - Types of microscopes cpalms tutorial - The legal system and adr analysis memo - They say i say chapter 11 he says contends summary - Commonwealth bank perls vi - PHILOSOPHY - Need Literature Review Outline - Hodson phonological processes chart