Total Marks: 20 Artificial Intelligence Mid Term Examination Course Code: CS-‐3811 Fig. 1: Road Map of Part of Romonia Fig. 2: Straight Line distances to Bucharest Q1: Using the Figures 1 and 2, show all the stages in the Recursive Best First Search for the shortest route to Bucharest. (6) Sol: Q2: Prove that the graph search version of A* is optimal if h(n) is consistent. (5) Sol: – – – – The first step is to establish the following: if h(n) is consistent, then the values of f(n) along any path are nondecreasing. The proof follows directly from the definition of consistency. Suppose n′ is a successor of n; then g(n′) = g(n) + c(n, a, n′) for some action a, and we have f(n′) = g(n′) + h(n′) = g(n) + c(n,a,n′) + h(n′) ≥ g(n) + h(n) = f(n). Second Step: A∗ selects a node n for expansion, the optimal path to that node has been found. Were this not the case, there would have to be another frontier node n′ on the optimal path from the start node to n, because f is nondecreasing along any path, n′ would have lower f-‐cost than n and would have been selected first. From the two preceding observations, it follows that the sequence of nodes expanded by A∗ using GRAPH-‐SEARCH is in nondecreasing order of f(n). Hence, the first goal node selected for expansion must be an optimal solution because f is the true cost for goal nodes (which have h = 0) and all later goal nodes will be at least as expensive. Q3: If you have concept of utility-‐based agents then draw its structure in the form of flow diagram. (3) Sol: Fig. 3: The track pieces in a wooden railway set; each is labeled with the number of copies in the set. Note that curved pieces and “fork” pieces (“switches” or “points”) can be flipped over so they can curve in either direction. Each curve subtends 45 degrees. Q4: A basic wooden railway set contains the pieces shown in Figure 3. The task is to connect these pieces into a railway that has no overlapping tracks and no loose ends where a train could run off onto the floor. (6) a) Suppose that the pieces fit together exactly with no slack. Give a precise formulation of the task as a search problem. b) Give an upper bound on the total size of the state space defined by your formulation. (Hint: think about the maximum branching factor for the construction process and the maximum depth, ignoring the problem of overlapping pieces and loose ends. Begin by pretending that every piece is unique.) Sol: a) Initial state: one arbitrarily selected piece (say a straight piece).Successor function: for any open peg, add any piece type from remaining types. (You can add to open holes as well, but that isn’t necessary as all complete tracks can be made by adding to pegs.) For a curved piece, add in either orientation; for a fork, add in either orientation and (if there are two holes) connecting at either hole. It’s a good idea to disallow any overlapping configuration, as this terminates hopeless configura- tions early. (Note: there is no need to consider open holes, because in any solution these will be filled by pieces added to open pegs.)Goal test: all pieces used in a single connected track, no open pegs or holes, no over- lapping tracks.Step cost: one per piece (actually, doesn’t really matter). b) The maximum possible number of open pegs is 3 (starts at 1, adding a two-peg fork increases it by one). Pretending each piece is unique, any piece can be added to a peg, giving at most 12+(2·16)+(2·2)+(2·2·2) = 56 choices per peg. The total depth is 32 (there are 32 pieces), so an upper bound is 16832/(12! · 16! · 2! · 2!) where the factorials deal with permutations of identical pieces. One could do a more refined analysis to handle the fact that the branching factor shrinks as we go down the tree, but it is not pretty.
© Copyright 2026 Paperzz