Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

coding question :) Steps: 1) Download the started code provided File name: hill climbing chess_board game.ipynb 2) Open jupyter notebook and navigate to downloaded folder

coding question :) image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Steps: 1) Download the started code provided File name: hill climbing chess_board game.ipynb 2) Open jupyter notebook and navigate to downloaded folder 3) Open above.ipynb file from jupyter notebook home 4) Read the description and understand the task 5) Finish the incomplete hill climbing algorithm Mark: Question 1: Implement generate_random_start_position() function - 3 marks Question 2: Implement evaluate() function - 3 marks Question 3: Finish code of mutate_solution() function - 1 marks Question 4,5 and 6: Finish code of hill climbingl) function - 3 marks Deadline: This is a group assignment. Finish the assignment before the assignment deadline. books/Hill_Climbing_che... Q 0 #H Hill_Climbing_chess_board_game Logout Trusted Python 3 O View Insert Cell Kernel Widgets Help Run Markdown Help king to reach at user-defined position in NxN chess board 1 King can move one position in any direction. Help king to reach at desired position(user input) using hill climbing algorithm. . The program takes one user input - Target location for king Hill climbing algorithm: Generate random position from whore king will start its move 8:17 PM wimbing_chess_board_game Logout Trusted Python 3 O View Insert Cell Kernel Widgets Help Run C Markdown Hill climbing algorithm: Generate random position from where king will start its move Check if the generated position is target position or not . If not: Generate next position of king Evaluate and check if generated position is heloing king to reach at target position If yes: Make a move check if it is a target position . If No: o Generate random next move and evaluate it and repeat this step until king reaches to target position 3 Input: Target location in form of list Output: List of node traversed to reach target position - If the tarfget position is [0,0] and king is star ting from [2.1] than output should be [12,1],[1,1], [0,0]] - If steating location is [1,3] and target location is [0,0] than, output = [[1, 3), (1.2), [1,1], [0, 011 17 PM 2/9/2021 Trusted Python 3 O Edit View Insert Cell Kernel Widgets Help Run Markdown Functions explanation: A 1: get_next_possible_steps() This function generate next possible positions for king. As we know, king can move one step in any direction. This function returns list of all the possible moves for king from specific position This function first generate all the nodes from previous, current and next node and than remove invalid nodes. There are three types of invalid entries: overlap or duplicates Border condition Border conditions - I king is on border nodes than it can not move in one direction situation shown in above image 17 PM 292021

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions