Unit 1

You might also like

Download as pdf
Download as pdf
You are on page 1of 18
/ INTRODUCTION TO ARTIFICIAL INTELLIGENCE Unit - 1: Introduction Syllabus: Tntroduction: Artificial Intelligence, Historical Backdrop, What is Artificial Intelligence, State Space Search: Generate and Test, Simple Search, Dep th First Search (DFS), Breadth First Search (BIS), Comparison of BES and DFS, Quality of Solution, Depth Bounded DFS (DBDFS), Depth First Iterative Deepening (DFID) Introduction: Artificial Intelligence What is Artificial Intelligence: According to the father of Artificial Intelligence, John McCarthy, it is “The science and engineering of making intelligent machines, especially intelligent computer programs”. Artificial Intelligence is a way of making a computer, a computer-controlled robot, or a software think intelligently, in the similar manner the intelligent humans think. Al is accomplished by studying how the human brain thinks, and how humans learn, decide, and work while trying to solve a problem, and then using the outcomes of this study as a basis of developing intelligent software and systems. Philosophy of AI © While exploiting the power of the computer systems, the curiosity of humans, led him to wonder, “Can a machine think and behave like humans do?” * Thus, the development of AI started with the intention of creating similar intelligence in machines that we find and regard high in humans. Goals of AI © To Create Expert Systems - The systems which exhibit int behaviour, learn, demonstrate, explain, and advice its users. « To Implement Human Intelligence in Machines ~ Creating systems that understand, think, learn, and behave like humans. elligent ‘Types of artificial intelligence—weak Al vs. strong AI © Weak Al—also called Narrow Al or Artificial Narrow Intelligence (ANI}— is Al trained and focused to perform specific tasks. Weak Al drives most of the Al that surrounds us today. ‘Narrow’ might be a more accurate descriptor for this type of Al as it is anything but weal; it enables some very robust applications, such as Apple's Siri, Amazon's Alexa, IBM Watson, and autonomous vehicles. © Strong AI is made up of Artificial General Intelligence (AGI) and Artificial Super Intelligence (ASI). Artificial general intelligence (AGI), or general Al, is a theoretical form of AI where a machine would have an et Ea tetas hi Cra s Arta btigne*by Dr, Dp hana IT" ath Pans Mila! Dey, BURIT ; it would have a selfay, intelligence equalled to humans; en paeeiatiend that has the ability to solve problems, learn, and plan for the future. Historical Backdrop & Future Artificial intelligence (AI) is a young discipline of sixty years, which is a sct of sciences, theories and techniques (including mathematical logic, Statistics, probabilities, computational neurobiology, computer science) that aims to imitate the cognitive abilities of a human being. Initiated in the breath of the Second World War, its developments are intimately linked to those of computing and have led computers to perform increasingly complex tasks, which could previously only be delegated to a human. However, this automation remains far from human intelligence in the strict sense, which makes the name open to criticism by some experts. The ultimate stage of their research (a “strong” Al, i.e. the ability to contextualize very different specialized problems in a totally autonomous way) is absolutely not comparable to current achievements ('weak" or "moderate" Als, extremely efficient in their training field). The "strong’ Al, which has only yet materialized in science fiction, would require advances in basic research (not just performance improvements) to be able to model the world as a whole, 1, 3. Since 2010: a new bloom based on massive data and new computing power. Future of Artificial Intelligence 1, Healthcare: ® The healthcare industry is bound to witness a drastic change. * Amtificially Intelligent robots would be employed for performing complex Surgeries with a high degree of precision. It puts consumers on top of things like health and well-being. * Additionally, Al increases the power for healthcare professionals to try \o understand the day-to-day patterns and wishes of the people they look after. * Thereupon understanding they're ready to provide better feedback, 8uidance and support for staying healthy, * Al would also be developed in wearable devices like watches and wrist bands to monitor the human body and predict any diseases if any. 2. Autonomous Vehicles * Everyone these days is all hyped about “Autonomous Vehicles”. Level 2.0 Autonomy has already been achieved by Tesla. Autonomous driving 1S one among the key application areas of Al. POE Cote date Boh ‘A it Eats Atl biomes by ‘Pro, Does Khurana Thanks Milectri Dey, BURIT Autonomous vehicles (AV) are equipped with multiple sensors, like cameras, radars and LIDAR, which help them better understand the environment and in path planning. ° ‘These sensors gencrate a huge amount of knowledge Once autonomous vehicles would be on road, cab services like Uber and Ola would be driverless. This would change the way transport industry functions. © The Autonomous Vehicle Market being driven by Al is projected to have a valuation of $127 billion by 2025. 3. Security and Defence lization cases for AI in defence and security are virtually © The util unlimited. * Als are often embedded into weapons and surveillance systems to reinforce performance. It is often to improve target recognition, combat simulation and training, and threat monitoring. Most importantly, the critical and risky jobs of securing the borders of the country can be delegated to artificially in telligent robots, unmanned aircraft, and drones, UAVs, etc. This would reduce the risk of lif provide better surveillance measu Technologies. 4, Manufacturing fe for the soldiers on the borders and res using evolved Facial Recognition ® Manufacturing in the near future would be fully automated. AI also optimizes manufacturing supply chains, helping ‘companies anticipate tuarket changes. This information is invaluable to manufacturers Hecause it allows them to optimize staffing, internal control, energy consumption and therefore the supply of raw materials «The manufacturing processes enabled by Artificially Intelligent systems would be able to not just perform the required processes but also be Able to inspect, improve, and quality checks the products without any human intervention. «In addition, according to the reports of Markets and markets, Artificial Intelligence in the manufacturing market is expected to Br", from USD LO billion in 2018 to USD 17.2 billion by 2025, at a CAGR of 49.5% during the forecast period. 5. Education © The future of classi on platforms which anywhere, anytime. duties for teachers and © Educators spend tons of homework, and providing v: allowing automation of classi ‘® The concept of education wi homes, personalized according of Artificially Intelligent systems. ca abe hute usb Pt Counter tlio Pr ap Khana IT" Ter there are a lot of courses d can be accessed from of administrative rooms is digital. Already, are highly informative an‘ ‘AI can automate the expedition academic institutions. their time on grading exams, assessing aluable responses to their students. Al is fication and processing of paperwork. ill be redefined from the comfort of the to every students’ needs with the help Niladtri Dey, BURIT © According to a report by Market Research Future (MRFR), enabled Ed-tech sector is projected to grow to USD 2 billion of 38% during 2018-2023, the a pata CAGE 6. Entertainment ¢ Already, the OTT’s like Netflix and Amazon Prime are rapidly increasing their user base. Smart algorithms are going to be ready to come up with the simplest marketing and advertising solutions, With Al, it's possible to form all marketing processes a couple of times faster by utilizing predictive analytics. In the future, the Al will be able to predict not just our preference, but also our mood and display content according to it. * Virtual Reality enabled sci-fi content and games can be a part of sources of entertainment in the future, « By 2021, the U.S. E&M industry is projected to reach $759 billion in revenue, increasing at a compound annual growth rate (CAGR) of 3.6 percent. 7. Workplace Businesses are using AI to enhance the productivity of their employees. The advantage of Al for business is that it handles repetitive tasks across a corporation in order that employees can specialize in creative solutions, complex problem solving, and impactful work. © One example of that is chatbot. * The concept of the workplace will also be redefined by the advent of technologies. The future workplace will not just be global in nature but also highly flexible. * The concept of Work from Home will be the new norm and digital conferences and meetings would be the accepted practice. This would cause the commercial real estate spaces to witness a drop in their demands. 8. Banking and Finance * Artificial Intelligence is the best way forward for banking because it | brings the facility of advanced data analytics to combat fraudulent transactions and improve compliance. * Alassistants, like chatbots, use Al to get personalized financial advice and work on processing to supply instant, self-help customer service. With increasingly efficient and intelligent systems, it becomes easier to detect and stop fraud in the banking sector. * For Example, Artificially Intelligent Systems can help in high-frequency trading, enhanced customer service and better decision making due to the faster processing of a large amount of data. Port ot Contant Adopted trem the Book ‘A Pint Course in Artfll Intelligence by “Prot. Despole Khemanl Tutt Thanks Niladri Dey, BURIT What is Artificial Intelligence Definition ~ 1: Artificial Intelligence (Al), the ability computer-controlled robot to perform tasks co intelligent beings. of a digital computer or mmonly associated with Definition - 2: Artificial intelligence is the simulation of human intelligence processes by machines, especially computer systems. Specific applications of Al include expert systems, natural language processing, speech recognition and machine vision. Definition - 3: Artificial intelligence (Al) applies advanced analysis and logic- based techniques, including machine learning, to interpret events, support and automate decisions, and take actions State Space Search State space search is a process used in the field of computer science, including artificial intelligence (Al), in which successive configurations or states of an instance are considered, with the intention of finding a goal state with a desired property. Problems are often modelled as a state space, a sct of states that a problem can be in. The set of states forms a graph where two states are connected if there is an operation that can be performed to transform the first state into the second. State space search often differs from traditional computer science search methods because the state space is implicit: the typical state space graph is much too large to generate and store in memory. Instead, nodes are generated as they are explored, and typically discarded thereafter. A solution to a combinatorial search instance may consist of the goal state itself, or of a path from some initial state to the goal state. Representation Insta space search, atte space trmaly represented asa up S (S, A, Action(s), Resuit(s a), Cost(s, a), wien. + Sis the sel of all possible states; + A's te set of possible actions, not relates to a particular state but regarding all the state space, + Action) se tcton hat etabish wen acten s possible o perforin certains; + Result(s, a) isthe functon that relums the state reached performing action a in sate s + Costa's the caso pertrmig an acon an sate In may late spaces is 2 constant, ut is nol te in genera Examples of state-space search algorithms 1, Uninformed search: According to Poole and Mack worth, the following are uninformed state-space search methods, meaning that they do not have any prior information about the goal's location a. Traditional depth-first search b. Breadth-first search c. Iterative deepening d, Lowest-cost-first search Pt ft Cente Adoted eth Boab ‘A Pt Cnanele Ae balipne*by Pras Dee ena Mt Thon Milactri Dey, BURIT 2, Heuristic search: Some algorithms take into account information about the goal node's location in the form of a heuristic function, Poole and Mackworth cite the following examples as informed search algorithms: a. Heuristic depth-first search b. Greedy best-first 5 c. A* search Generate and Test Introduction Generate and Test Search is a heuristic search technique based on Depth First Search with Backtracking which guarantees to find a solution if done systematically and there exists a solution. In this technique, all the solutions are gencrated and tested for the best solution. It ensures that the best solution is checked against all possible generated solutions, It is also known as British Museum Search Algorithm as it’s like looking for an exhibit at random or finding an object in the British Museum by wandering randomly. The evaluation is carried out by the heuristic function as all the solutions are generated systematically in generate and test algorithm but if there are some paths which are most unlikely to lead us to result then they are not considered. The heuristic does this by ranking all the alternatives and is often effective in doing so. Systematic Generate and Test may prove to be ineffective while solving complex problems. But there is a technique to improve in complex cases as well by combining generate and test search with other techniques so as to reduce the search space. For example, in Artificial Intelligence Program DENDRAL we make use of two techniques, the first one is Constraint Satisfaction Techniques followed by Generate and ‘Test Procedure to work on reduced search space i.e. yield an effective result by working on a lesser number of lists generated in the very first step. Algorithm Genezate And Test () while more candidates exist do Generate a candidate Test whether it is a scluticn 4 return FAILURE wre © Generate a possible solution. For example, generating a particular point in the problem space or generating a path for a start state. | © Test to see if this is an actual solution by comparing the chosen point or the endpoint of the chosen path to the set of acceptable goal states * Ifa solution is found, quit. Otherwise go to Step 1 Petts Content Adopted nthe Bok "A Ft Coury ln Ansel intllgence”by "Pret. Deepa Kant ITM" sth Thanks Niladrl Dey, BURIT Simple Search Based on the search problems we can classify the sear uninformed (Blind search) search and informed algorithms. ch algorithms into Search (Heuristic search) SimpleSearch2 () 1 open © {stare} 2 closed (} 3 while cpen is not empty 4 do Pick some node n from open 5 open — open \ (n} é closed © closed U {n} 7 if GoalTest(n) = TRUE € then return n ‘ d else cpen < cpen U (MoveGen(n) \ closed} Greturn FAILURE Search Algorithm: Artificial Intelligence Uninformed/Blind Search: The uninformed search does not contain an closeness, the location of the goal. It operates in a brute-force way as it only includes information about how to traverse the tree and how to identify leaf and goal nodes. Uninformed search applies a way in which search tree is searched without any information about the search space like initial state Operators and test for the goal, so it is also called blind search. It examines each node of the tree until it achieves the goal node. y domain knowledge such as Search Algorithm Uniformed/Blind Informed Search Breadth first search Best First Search Uniform cost search ‘Mesarch Depth rst search Depth limited search Iterative deeping depth first search, Bidirectional search Pot of ths Cotent Adopted from the Boo ‘A Fit Cour ln Atl ltllgance*by "Prot, Depa Karank ITH" ulthPhenbs Niladri Dey, BURIT It can be divided into five main types: Breadth-first search Uniform cost search Depth-first search Iterative deepening depth-first search Bidirectional Search. Depth First Search (DFS) Depth first search (DFS) algorithm starts with the initial node of the graph G, and then goes to deeper and deeper until we find the goal node or the node which has no children. The algorithm, then backtracks from the dead end | towards the most recent node that is yet to be completely unexplored. The data structure which is being used in DFS is stack. The process is similar to BFS algorithm. In DFS, the edges that leads to an unvisited node are called discovery edges while the edges that leads to an already visited node are called block edges. Algorithm 1 i Step-1. SET STATUS = 1 (ready state) for each node in G + Step Push the starting node A on the stack and set its STATUS = 2 i (waiting state) Step -3. Repeat Steps 4 and 5 until STACK is empty Step - 4. Pop the top node N. Process it and set its STATUS = 3 (processed state) : Step -5. _ Push on the stack all the neighbours of N that are in the ready state (whose STATUS ) and set their a. STATUS = 2 (waiting state) b. [END OF LOOP| Step-6. EXIT hy Pret Deep Konan IT" Tanks Part eft Contant Adopted es the Bok ‘A Fit Curse Anta ieteiomee by "Pret. Niladiri Dey, BVRIT Algorithm 2 DepthFizstsi eh () 1 open © ((ztert NIZ)) 2 closed © 0) 3 while not Null (oper) 4 do nodePeir @ Head(open) 5 node «= Head(nodePaiz) é Af GoalTest(node) = TRUE 7 then return ReconstructPath(nodePair, closed) 8 else closed © Cons (nodePair, closed) 8 children © MoveGen (node) u 0 noLoops + RemoveSeen(children, open, closed) an new © MakePairs(noLoops, node) az open © Append(new, Tail (open)) 13 return “No solutien found” RenoveSeen(nodeList, opentist, closedbist} Mull (nodeZise) then return () else n | Head(nodebisc) A (Ocoursin(n, openbigt) OR OccursIn(n, clozedzist)) then return Renoveseen(Tail(nodelist), opentist, closedList) else return Cons(n,Renoveseen (Tail (nodeList), opentist, clovedisst) occursin(node, 1istosPairs) 1 4€ wuld (1tetofPairs) 2 thenreturn FALSE 3 elsed€ n = Head(Head(1istofPairs) 4 then return 7RUE 3 else return Occursin(node, Tail(1istOfPairs)) 3 4 5 ‘ MakeFaizs (List, parent) Af mull (Lise) 2 then return () 3 else return Cons (MakeList (Head(1ise), parent), MakePaizs(Tail (list), parent) Example: Consider the graph G along with its adjacency list, given in the figure below. Calculate the order to print all the nodes of the graph starting from node H, by using depth first search (DFS) algorithm. Adjacency Lists A:B,D BIGr Cie, GH Port oth Cantal Adepted tom the Boa ‘AF Couraln Atl ltllpance"by "Bret, Deepa Kaman ITH!*alth Thanbs Niladrl Dey, BURIT ii Example: Adjacency Lists Step 1 - First, push H onto the stack. STACK: H ‘Step 2 - POP the top element from the stack, i.e., H, and print it. Now, PUSH all the neighbors of H onto the stack that are in ready state. Print: HJSTACK: A Step 3 - POP the top element from the stack, i.e., A, and print it. Now, PUSH all the neighbors of A onto the stack that are in ready state. Print: A STACK: B, D Step 4 - POP the top element from the stack, i.e., D, and print it. Now, PUSH all the neighbors of D onto the stack that are in ready state. Print: D STACK: B, F Step 5 - POP the top element from the stack, i.e., F, and print it. Now, PUSH all the neighbors of F onto the stack that are in ready state, Print: F STACK: B Step 6 - POP the top element from the stack, i.e., B, and print it, Now, PUSH all the neighbors of B onto the stack that are in ready state. Print: B STACK: C Step 7 - POP the top element from the stack, i.e., C, and print it, Now, PUSH all the neighbors of C onto the stack that are in ready state. Print: C pewwob Karsan ITH" th Thanks Pot ofr Cantat ls Adopted tr the Boob ‘A Ft Coure in Artifice lnteltznce*by "Pret. Deco Kvemony ITM Niladri Dey, BURIT eed STACK: E, G Step 8 - POP the top element from the stack, i.e., G and PUSH all the neighbors of G onto the stack that are in ready state. Print: G STACK: E Step 9 - POP the top element from the stack, i.e., E and PUSH all the neighbors of E onto the stack that are in ready state. Print: E STACK: Now, all the graph nodes have been traversed, and the stack is empty. ‘Try it out by Yourself: Case -I: = Case - II: ‘Pet of ths Content Adopted tran the Book ‘A Flot Core la Atif ltligance"by "Pret, Deepa Kartal IT*ulh Thanbs Niladri Dey, BVRIT em h First Search (BFS) Breadtl rst search is a graph traversal algo’ Breadth fi s graph from root node and explores all the neig! the nearest node and explore all the unexplored no the same process for each of the nearest node unti The algorithm of breadth first search is examining the node A and all of its n neighbours of the nearest node of A are explored and process continues in the further steps. The algorithm explores all neighbours of all the nodes and res that each node is visited exactly once and no node is visited twice. rithm that starts traversing the shbouring nodes. Then, it selects ‘odes. The algorithm follows it finds the goal. given below. The algorithm starts with eighbours. In the next step, the ensu Algorithm - 1 step - 1. SET STATUS = 1 (ready state) a. for each node in G Step - 2. Enqueue the starting node A a. and set its STATUS = 2 b. (waiting state) Step - 3. Repeat Steps 4 and 5 until a. QUBUE is empty Step - 4. Dequeue a node N. Process it . and set its STATUS = 3 . (processed state). Step - 5. Enqucue all the neighbours of . N that are in the ready state . (whose STATUS = 1) and set . their STATUS = 2 . (waiting state) . [END OF LOOP] ). EXIT a. b. a. db. 2 d. e. Step - 6. aunt itetigence*by ‘Pret. Deeps Rhemant ITM" uith Thombs Part tts ante Adeted rn the Bab ‘A Ft nav Niladri Dey, BVRIT : BreadthFirstSearch () 1 open & ((starc, NTL) 2 closed | {) 3 while not Null (open) 4 donodePair © Head(open) 5 node « Head(nodePair) é Af GoalTest (node) = TRUE a then return ReconstructPath(nodePair, closed) € else closed — Cons(nodePair, closed) “6 children © MoveGen (node) lo noLoops « RemoveSeen (children, open, closed) ql new © MakePairs(noLoops, node) 12 open © Append(Tail(open), nev) 13return “No scluticn found” Example Step 1 - First, add A to queuel and NULL to queue2. QUEUE] = {4} QUEUE2 = {NULL} Step 2 - Now, delete node A from queue! and add it into queue2. Insert all neighbors of node A to queuel. QUEUE] = B, D} QUEUE? = {A} Step 3 - Now, delete node B from queuel and add it into queue2. Insert all neighbors of node B to queuel. QUEUEI = {D, C, F} QUEUE2 = {A, B} Dot of thy Conte Adopted rm the Book "A Flot Cour ln Atal ltlpance"by "Pref, Deepa Khemant ITM" th Thanks Niladri Dey, BURIT Step 4 - Now, delete node D from queuel and add it into queue2, Ins, all neighbors of node D to queuel. The only neighbor of Node D is F since it is already inserted, so it will not be inserted again. QUEUE! = {C, F} QUEUE2 = A, B, D} Step 5 - Delete node C from queuel and add it into queue2. Insert all neighbors of node C to queuel. QUEUE] = {F, E, G} QUEUE? = {A, B, D, C} Step 5 - Delete node F from queuel and add it into queue2. Insert all neighbors of node F to queuel. Since all the neighbors of node F are already present, we will not insert them again. QUEUE] = {E, G} QUEUE2 = {A, B, D, C, F} Step 6 - Delete node E from queuel. Since all of its neighbors have already been added, so we will not insert them again. Now, all the nodes are visited, and the target node E is encountered into queue2. QUEUE! = {G} QUEUE2 = {A, B, D, C, F, E} ‘Try it out by Yourself: Case - I: Case - II: sean Auth Track Pvt ot Content li Adopted fem the Bosh ‘A Pet Corre ln Ariel taigace* by “re. Deepal Kenan I Niladtri Dey, BURIT Comparison of BFS and DFS * BFS stands for Breadth First Search i ; z is ave finding a shortest path in graph, It uses a Quet follows first in first out. In BFS, one vertex is selected at a tim: iti ‘8, one : ed a ¢ when it is visited arene sel 1 ed and marked then its adjacent are isited and stored in the queue. It is slower than DFS stands for Depth First Search is an ed i a edge based technique. It us the ee ao structure, performs two stages, first visited vertices aS pushed into stack and second if there are i isi pustet nel steer no vertices then visited tex based technique for a Queue data structure which Quality of Solution Optimal solution An optimal solution to a problem is one that is the best solution according to some measure of solution quality. This measure is typically specified as an ordinal, where only the order matters. However, in some situations, such as when combining multiple criteria or when reasoning under uncertainty, you need a cardinal measure, where the relative magnitudes also matter. An example of an ordinal measure is for the robot to take out as much trash as possible; the more trash it can take out, the better. As an example of a cardinal measure, you may want the delivery robot to take as much of the trash as possible to the garbage can, minimizing the distance travelled, and explicitly specify a trade-off between the effort required and the proportion of the trash taken out. It may be better to miss some trash than to waste too much time. One general cardinal measure of desirability, known as utility, is used in decision theory. Satisficing solution Often an agent does not need the best solution to a problem but just needs some solution. A satisficing solution is one that is good enough according to some description of which solutions are adequate. For example, a person may tell a robot that it must take all of trash out, or tell it to take out three items of trash. Approximately optimal solution One of the advantages of a cardinal measure of success is that it allows for approximations. An approximately optimal solution is one whose measure of quality is close to the best that could theoretically be obtained. Typica ly, agents do not need optimal solutions to problems; they only must get close enough. For example, the robot may not need to travel the optimal distance to take out the trash but may only need to be within, say, 10% of the optim: distance. For some problems, it is much easier computationally to get an approximately optimal solution than to get an optimal solution. However, Es Sther problems, it is (asymptotically) just as difficult to guarantee nding an approximately optimal solution as it is to guarantee finding an opti puto Contant Adopted tran the Bock “Ait curva ln Atta tegen" by "Pret, Deepa Kanani ITM "ulth Thenks Niladri Dey, BURIT soluti : ion i aaa Some approximation algorithms guarantec that a solution is within ‘ange of optimal, but for some algorithms no guarantees are available, Probable solution A probable solution is one that, even though it may not actually be a solution to the problem, is likely to be a solution. This is one way to approximate, in a precise manner, a satisficing solution. For example, in the case where the delivery robot could drop the trash or fail to pick it up when it attempts to, you may need the robot to be 80% sure that it has picked up three items of trash. Often you want to distinguish the false-positive error rate (the proportion of the answers given by the computer that are not correct) from the false-negative error rate (which is the proportion of those answers not given by the computer that are indeed correct). Some applications are much more tolerant of one of these errors than of the other. Depth Bounded DFS (DBDFS) Depth bounded DFS algorithm is different from DFS, in that it takes a parameter for depth bound. Given any node, it calls moveGen only if it is within the given depth bound. The node representation is changed to include depth of node as the third parameter, apart from the parent link, which is the second parameter. The function makePairs is modified appropriate to compute the depth of a node, by adding one to the depth of its parent. The Reader would have observed that implementing DBDFS would have been simpler with the nobel representations that stored the complete path. One would just have to look at the length of the node to determine whether one is within the allowable bound. And in addition, the task of reconstructing the path is also simplified. Obviously, various design choices will have to be made Rhile implementing solutions for specific problems. Performance wise the DBDFS is like DFS or a finite tree. However, given that the Depth bound is artificially imposed, the algorithm is not complete in the general case. DepthBoundedDF (start, depthBounded) open - ( (start, NIL, 0) } closed - () while not Null (open) do nodePair - Head (open) node - Head(nodePair) if GoalTest (node) = TRUE then return ReconstructPath (nodePair, closed) else closed - Cons (nodePair, closed) if Head(Rest (Rest (nodePair) )) < depthBound then children - MoveGen (node) rol. oops - RemoveSeen(children, open, closed) : new - MakePairs(noLoops, node, Head{Rest (Rest(nodePair) ))) open - Append(new, Taillopen) ) return "No solution found” po eto aspen Bo Car At sakePairs (ist, parent, depth) if Null(list) then return () else return (Cons (MakeList( Head (list), parent, deptht1 )), MakePairs (Tail(list), parent, depth) ) Depth First Iterative Deepening (DFID) ‘There are two common ways to traverse a graph, BFS and DFS. Considering a Tree (or Graph) of huge height and width, both BFS and DPS are not very efficient due to the following reasons. IDDFS combines depth-first search’s space-elliciency and breadth-first search’s fast search (for nodes closer to root). 77 Returns true if target is reachable from ]/ sre within max_depth bool IDDFS(src, target, max depth) for limit from 0 to max_depth if DLS(sre, target, limit) return true return false 4 ool DiS{sre, target, limit) if (sre == target) return true; // reached the maximum depth, // stop recursing. if Gimit <= 0) retum false; foreach adjacent i of sre ‘if DLS(G, target, limit?1) return true return false part of he Content Adopted ra the Bob ‘A Pit Cotre nA taligene"by Prof, Dope KharanL ITA" atth Thanks Niladri Dey, BURIT ‘Try it out by Yourself: 1. The n-queens problem is to place n queens on an n-by-n chessboard, such that no queen attacks another, as per chess rules. Pose the problem as a search problem. 2. Another interesting problem posed on the chessboard is the knight's tour. Starting at any arbitrary starting point on the board, the task is to move the knight such that it visits every square on the chessboard exactly once, Write an algorithm to accept a starting location on a chessboard and generate a knight's tour. Important Subjective Questions Define Artificial Intelligence Provide a briefer history with the major milestones in the field of Al Define State Space Demonstrates Depth First Search with a suitable Example Demonstrates Breadth First Search with a suitable Example Demonstrates Depth Bounded DFS with a suitable Example Demonstrates Depth First Iterative Search with a suitable Example NpaPeyr Assignment Questions Like and Subscribe the updates — outube.com/@frecfaculty6787 /playli END OF UNIT -1 par ota Contr vAated emt Bo Pt Crea Antler by "et Daa aman Mh ace Niladri Dey, BURIT

You might also like