Solving problems by searching

Size: px
Start display at page:

Download "Solving problems by searching"

Transcription

1 Solving problems by searching Based on: Stuart Russell, Peter Norvig, Articial Intelligence: A Modern Approach, 2009 Katadra Automatyki Akademia Górniczo-Hutnicza spring 2011 (KA AGH) spring / 70

2 Lecture Plan 1 The algorithm The algorithm 2 Graph as a model of the Search Space 3 Blind search strategies 4 Informed search strategies 5 (KA AGH) spring / 70

3 We dene a problem by providing: State space S. Initial state s I S. Actions available within given state. a Goal test or goal state s G S. b Cost function γ, Forbidden states F S. a Usually dened as so-called successor function which, for a given state, returns the set of available actions. b Explicit (designated state) or implicit (goal satisfaction solutions). Formal problem denition A problem P is dened as six-tuple: P = (S, s I, s G, F, O, γ). (KA AGH) spring / 70

4 State-Space and Problem Solution State-Space A state-space is a set of potential/feasible/legal states of some system. A state-space can be discrete (nite) or continuous. States A state representes local description of a system which is: complete, consistent, minimal. Problem solution For P = (S, s I, s G, F, O, γ) its solution is dened by a sequnece (o 1, o 2,..., o n ), such that: o 1 (s I ) = s 1, o 2 (s 1 ) = s 2,..., o n (s n 1 ) = s G Induced sequnece of states s I = s 0, s 1, s 2,..., s n = s G. (KA AGH) spring / 70

5 Example: a trip to Romania Example problem statement We are in Arad in Romania. Our plane leaves tomorrow from Bucharest. Problem statement State space: distingushed cities Initial state: Arad Available actions: travel to another city (see map) Goal test: Are we in Bucharest? or Goal state: Bucharest Cost function: sum of road lengths to given city Forbidden states: optional (KA AGH) spring / 70

6 Map of Romania 71 Oradea Zerind 75 Arad Timisoara Dobreta Neamt Iasi 92 Sibiu 99 Fagaras Vaslui 80 Rimnicu Vilcea 142 Lugoj Pitesti Hirsova Mehadia Urziceni Bucharest Craiova Eforie Giurgiu (KA AGH) spring / 70

7 7 5 8 Example: 8-puzzle 2 3 Start State Problem statement Goal State State space: all possible combinations of tile locations Initial state: any of the above states Available actions: legal moves (from: Left, Right, Up, Down) Goal test: are all tiles in order? Cost function: number of steps in path (KA AGH) spring / 70

8 Example State-Space Search Problems Toyproblems Missionaries and cannibals, Towers of Hanoi, Block World, Criptoarithmetic problems, N-queens problem. More serious applications Route planning, Agent action planning, Robot navigation, Symbolic integration, term rewriting, Conguration, assembly, package planning. (KA AGH) spring / 70

9 State space vs. search tree The dierence State space represents the states of the search space. Search tree shows how we proceed within the state space. A node in the search tree consists of: state to which it corresponds, parent node which generated (among others) this node, action applied to generate this node, path cost g(n) from initial state to this node, depth, i.e. number of steps from initial state. (KA AGH) spring / 70

10 Tree search Informal algorithm Basic idea: offline, simulated exploration of state space by generating successors of already-explored states (a.k.a. expanding states) function ( problem, strategy) returns a solution, or failure initialize the search tree using the initial state of problem loop do if there are no candidates for expansion then return failure choose a leaf node for expansion according to strategy if the node contains a goal state then return the corresponding solution else expand the node and add the resulting nodes to the search tree end Chapter 3 25 (KA AGH) spring / 70

11 Important denitions Search strategy Decides, which node (among those determined by available actions) is expanded next. Fringe (frontier) Queue of nodes to be expanded. (KA AGH) spring / 70

12 Evaluation of search Completeness Is the algorithm guaranteed to nd a solution if one exists? Optimality When the algorithm nds a solution, is this the optimal one? Time complexity How long does it take to nd a solution? a a Often measured as number of nodes generated during search. Space complexity How much memory is needed to perform the search? a a Often measured as maximum number of nodes stored in memory. (KA AGH) spring / 70

13 Implementation: The general algorithm tree search Implementation: general tree search function ( problem, fringe) returns a solution, or failure function fringe ( Insert(Make-Node(Initial-State[problem]), problem, fringe) returns a solution, or fringe) failure fringe loop do Insert(Make-Node(Initial-State[problem]), fringe) loopifdofringe is empty then return failure if node fringe Remove-Front(fringe) is empty then return failure node if Goal-Test(problem, Remove-Front(fringe) State(node)) then return node if fringe Goal-Test(problem, InsertAll(Expand(node, State(node)) then problem), return fringe) node fringe InsertAll(Expand(node, problem), fringe) function Expand( node, problem) returns a set of nodes function successors Expand( thenode, empty problem) set returns a set of nodes successors for each action, the empty resultset in Successor-Fn(problem, State[node]) do for each s aaction, new Node result in Successor-Fn(problem, State[node]) do s Parent-Node[s] a new Node node; Action[s] action; State[s] result Parent-Node[s] node; Action[s] action; State[s] result Path-Cost[s] Path-Cost[node] + Step-Cost(node, action, s) Path-Cost[s] Path-Cost[node] + Step-Cost(node, action, s) Depth[s] Depth[node] + 1 Depth[s] Depth[node] + 1 add s to successors add s to successors return successors return successors (KA AGH) spring / 70

14 Problems Solution A B C D Avoiding repeated states Loops (solution: remember path). Innite paths (solution: limit cost). Repeated search of nodes (solution: store all nodes). C Any algorithm that forgets its history is doomed to repeat it. Modify the algorithm to include a so-called closed list, storing every expanded node. The new algorithm is called. B C A C B C (KA AGH) spring / 70

15 The algorithm Graph search function ( problem, fringe) returns a solution, or failure closed an empty set fringe Insert(Make-Node(Initial-State[problem]), fringe) loop do if fringe is empty then return failure node Remove-Front(fringe) if Goal-Test(problem, State[node]) then return node if State[node] is not in closed then add State[node] to closed fringe InsertAll(Expand(node, problem), fringe) end (KA AGH) spring / 70

16 Lecture Plan 1 2 Graph as a model of the Search Space 3 Blind search strategies 4 Informed search strategies 5 (KA AGH) spring / 70

17 Basic intuitive formulation of a graph A graph is a set of nodes (vertices) interconnected with links (edges). A graph is a model of a search space. (KA AGH) spring / 70

18 Formal denitions of a graph I Denition: Simple Directed Graph V a nite set of vertices (or nodes), V = {v 1, v 2,..., v n }, E a nite set of edges (or links); E V V. A simple directed graph G is dened as G = (V, E). Denition: Directed Graph A directed graph G is any four-tuple G = (V, E, α, ω) α: E V is a function dening the starting point of an edge, ω is a function ω : E V dening the end point of an edge. (KA AGH) spring / 70

19 Formal denitions of a graph II Denition: Undirected Graph An undirected graph G is any triple G = (V, E, λ) where λ is a function of the form λ: E V 2, V 2 = {{v i, v j }: v i, v j V } dening the endpoints for an edge. a a An alternative denition is also possible: G = (V, E, λ), λ : E V 2 ; however, the denition used is more appropriate for further statements. (KA AGH) spring / 70

20 Formal denitions of a graph III Denition: Mixed Graph A mixed graph G is any ve-tuple G = (V, E 1, E 2, α, ω, λ) where E 1 is a set of directed links, E 2 is a set of undirected links; sets E 1 and E 2 are disjoint (E 1 E 2 = ). Further λ, α and ω are dened as before; α and ω are dened over E 1 and λ is dened over E 2. (KA AGH) spring / 70

21 : visualisation (KA AGH) spring / 70

22 : visualisation (KA AGH) spring / 70

23 Lecture Plan 1 2 Graph as a model of the Search Space 3 Blind search strategies Breadth-First Search () Uniform-Cost Search () Depth-First Search () Deepening Search 's Algorithm of Algorithms 4 Informed search strategies 5 (KA AGH) spring / 70

24 Breadth-First Search () Breadth-rst search strategy All nodes on a given level are expanded rst. Only then deeper nodes are expanded. A B C D E F G (KA AGH) spring / 70

25 Breadth-First Search () Breadth-rst search strategy All nodes on a given level are expanded rst. Only then deeper nodes are expanded. A B C D E F G (KA AGH) spring / 70

26 Breadth-First Search () Breadth-rst search strategy All nodes on a given level are expanded rst. Only then deeper nodes are expanded. A B C D E F G (KA AGH) spring / 70

27 Breadth-First Search () Breadth-rst search strategy All nodes on a given level are expanded rst. Only then deeper nodes are expanded. A B C D E F G (KA AGH) spring / 70

28 Breadth-First Search () characteristics Completeness: if the branching factor is nite and the goal node is at depth d, will eventually nd it. Optimality: is optimal if path cost is a non-decreasing function of depth. a Time complexity: 1 + b + b 2 + b b d + b(b d 1) = O(b d+1 ). Space complexity: O(b d+1 ). b a Otherwise, the shallowest node may not necessarily be optimal. b b branching factor; d depth of the goal node (KA AGH) spring / 70

29 in 8-puzzle problem (KA AGH) spring / 70

30 Uniform-Cost Search () Uniform-cost search strategy Expands the node with the lowest cost from the start node rst. a Completeness: yes, if cost of each step ɛ > 0. Optimality: same as above nodes are expanding in increasing order of cost. Time and space complexity: O(b 1+ C /ɛ ). b a If all step costs are equal, =. b C cost of optimal solution (KA AGH) spring / 70

31 Depth-First Search () Depth-rst search strategy rst expands the deepest node in the fringe. A B C D E F G H I J K L M N O (KA AGH) spring / 70

32 Depth-First Search () Depth-rst search strategy rst expands the deepest node in the fringe. A B C D E F G H I J K L M N O (KA AGH) spring / 70

33 Depth-First Search () Depth-rst search strategy rst expands the deepest node in the fringe. A B C D E F G H I J K L M N O (KA AGH) spring / 70

34 Depth-First Search () Depth-rst search strategy rst expands the deepest node in the fringe. A B C D E F G H I J K L M N O (KA AGH) spring / 70

35 Depth-First Search () Depth-rst search strategy rst expands the deepest node in the fringe. A B C D E F G H I J K L M N O (KA AGH) spring / 70

36 Depth-First Search () Depth-rst search strategy rst expands the deepest node in the fringe. A B C D E F G H I J K L M N O (KA AGH) spring / 70

37 Depth-First Search () Depth-rst search strategy rst expands the deepest node in the fringe. A B C D E F G H I J K L M N O (KA AGH) spring / 70

38 Depth-First Search () Depth-rst search strategy rst expands the deepest node in the fringe. A B C D E F G H I J K L M N O (KA AGH) spring / 70

39 Depth-First Search () Depth-rst search strategy rst expands the deepest node in the fringe. A B C D E F G H I J K L M N O (KA AGH) spring / 70

40 Depth-First Search () Depth-rst search strategy rst expands the deepest node in the fringe. A B C D E F G H I J K L M N O (KA AGH) spring / 70

41 Depth-First Search () Depth-rst search strategy rst expands the deepest node in the fringe. A B C D E F G H I J K L M N O (KA AGH) spring / 70

42 Depth-First Search () Depth-rst search strategy rst expands the deepest node in the fringe. A B C D E F G H I J K L M N O (KA AGH) spring / 70

43 in 8-puzzle problem (KA AGH) spring / 70

44 Depth-First Search () characteristics Small space requirements: only the path to the current node and the siblings of each node in the path are stored. Backtracking search generates only one successor for each node. Completeness: no, if the expanded subtree has an innite depth. Optimality: no, if a solution located deeper, but located in a subtree expanded earlier, is found. Time complexity: O(b m ). Space complexity: O(bm) (linear!). (KA AGH) spring / 70

45 Depth-Limited Search (DLS) Depth-limited search strategy Modication of Depth-First Search. We introduce a maximum depth l; nodes located at depth l are treated as if they had no successors. Returns two error types: failure means no solution, cuto means no solution within given depth limit. Why DLS is not widely used? For most problems, one does not know a good depth limit until the problem is solved... (KA AGH) spring / 70

46 Depth-limited search Depth-Limited Search (DLS) = depth-first search with depth limit l, i.e., nodes at depth l have no successors Recursive implementation: function Depth-Limited-Search( problem, limit) returns soln/fail/cutoff Recursive-DLS(Make-Node(Initial-State[problem]), problem, limit) function Recursive-DLS(node, problem, limit) returns soln/fail/cutoff cutoff-occurred? false if Goal-Test(problem, State[node]) then return node else if Depth[node] = limit then return cutoff else for each successor in Expand(node, problem) do result Recursive-DLS(successor, problem, limit) if result = cutoff then cutoff-occurred? true else if result failure then return result if cutoff-occurred? then return cutoff else return failure Chapter 3 60 (KA AGH) spring / 70

47 -Deepening Search () -deepening depth-rst search strategy Deepening Search. is a strategy for determination of optimal depth limit. Just like, expands an entire layer of new nodes before going deeper. Limit = 0 A A (KA AGH) spring / 70

48 -Deepening Search () -deepening depth-rst search strategy Limit = 1 Deepening Search. is a strategy for determination of optimal depth limit. Just like, expands an entire layer of new nodes before going deeper. B A C B A C B A C B A C (KA AGH) spring / 70

49 -Deepening Search () -deepening depth-rst search strategy Limit = 2 Deepening Search. is a strategy for determination of optimal depth limit. Just like, expands an entire layer of new nodes before going deeper. B A D E F G B A D E F G C C B A D E F G B A D E F G C C B A D E F G B A D E F G C C B A D E F G B A D E F G C C (KA AGH) spring / 70

50 -Deepening Search () -deepening depth-rst search strategy Limit = 3 Deepening Search. is a strategy for determination of optimal depth limit. Just like, expands an entire layer of new nodes before going deeper. B B A D E F G H I J K L M N O A D E F G H I J K L M N O A C C B B A D E F G H I J K L M N O A D E F G H I J K L M N O A C C B B A D E F G H I J K L M N O A D E F G H I J K L M N O A C C B B A D E F G H I J K L M N O A D E F G H I J K L M N O A C C B C B C B C B C D E F G D E F G D E F G D E F G H I J K L M N O H I J K L M N O H I J K L M N O H I J K L M N O (KA AGH) spring / 70

51 -Deepening Search () characteristics Completeness: yes. Optimality: yes, if step cost = 1. Time complexity: (d + 1)b 0 + db 1 + (d 1)b b d = O(b d ). Space complexity: O(bd). Numerical comparison for b = 10, d = 5 N() = = N() = = Conclusion exhibits better performance, because it does not expand other nodes at depth d. (KA AGH) spring / 70

52 's Algorithm General description Finds the shortest path with a single source in a graph with non-negative edge weights. More information and examples (clickable links) Wikipedia PL Wikipedia EN I LO w Tarnowie (KA AGH) spring / 70

53 Bidirectional Search Ideas for bidirectional search Start the search from the initial node and the goal node in parallel. The main advantage: depth cut by 2. Problems with bidirectional search works only for -like strategies, costly test for achieving the goal, goal node must be dened explicitly (not a goal test), expand function must be reversible. (KA AGH) spring / 70

54 where: of Algorithms Criterion DLS Complete? Yes 1 Yes 2 No Yes 3 Yes Time b d+1 b 1+ C /ɛ b m b l b d Space b d+1 b 1+ C /ɛ bm bl bd Optimal? Yes 4 Yes No No Yes 5 b branching factor, d depth of shallowest solution, m maximum depth of search tree, l depth limit. 1 if b < 2 if b < and step costs ɛ > 0 3 if l d 4 if step costs are equal 5 if step costs are equal (KA AGH) spring / 70

55 Concluding Remarks For blind strategies DL is often preferred, the current path is used to avoid cycles, depth is checked to stay within the current depth limit, the cost function may be used to restrict search, forbidden states restrict the search, dynamic search-space reconguration with constraint propagation. (KA AGH) spring / 70

56 in Prolog path(f,f,t,t). path(i,f,path,t):- p(i,n), not(member(n,path)), path(n,f,[n Path],T). go(i,f,path):- path(i,f,[i],path). (KA AGH) spring / 70

57 in Prolog bf(f,[[f Path] _],[F Path]). bf(f,[path SetOfPaths],T):- extend(path,newpaths), append(setofpaths,newpaths,newsetofpaths), bf(f,newsetofpaths,t). extend([n Path],NewPaths):- bagof([nextn,n Path],(p(N,NextN), not(member(nextn,[n Path]))),NewPaths),!. extend(_,[]). go(i,f,path):- bf(f,[[i]],path). (KA AGH) spring / 70

58 Lecture Plan 1 2 Graph as a model of the Search Space 3 Blind search strategies 4 Informed search strategies 5 (KA AGH) spring / 70

59 Blind vs. informed search strategies Blind search methods You already know them:,, et al. They don't analyse the nodes in the fringe; they simply pick the rst one (going down or sideways). Informed search methods They try to guess which node in the fringe is most promising......by using an evaluation function, also known as the heuristic. The heuristic is based on additional knowledge about the search space. (KA AGH) spring / 70

60 algorithm family General approach: picks node for expansion based on evaluation function, f (n). We don't know goal is best; if we knew, it wouldn't be a search at all. Heuristic function h(n) is the key component of f (n). Heuristic functions h(n) = estimated cost of the cheapest path from node n to the goal node. If n is the goal node, h(n) = 0. (KA AGH) spring / 70

61 Heuristic functions Choosing an evaluation function Arad If we know the locations of cities, we know the straight-line distances between them. h SLD straight-line distance from n to Bucharest. 71 Zerind Timisoara Oradea Lugoj 70 Dobreta Mehadia 120 Sibiu Craiova Fagaras Rimnicu Vilcea 97 Pitesti Neamt Bucharest Giurgiu 87 Iasi Urziceni Vaslui Hirsova 86 Eforie Straight line distance to Bucharest Arad 366 Bucharest 0 Craiova 160 Dobreta 242 Eforie 161 Fagaras 178 Giurgiu 77 Hirsova 151 Iasi 226 Lugoj 244 Mehadia 241 Neamt 234 Oradea 380 Pitesti 98 Rimnicu Vilcea 193 Sibiu 253 Timisoara 329 Urziceni 80 Vaslui 199 Zerind 374 (KA AGH) spring / 70

62 Admissible heuristic Heuristic functions Never overestimates the cost to reach the goal, e.g. h(n) h (n) (where h (n) is the real cost to get from n to goal). Is by nature optimistic. Monotonic (consistent) heuristic For every node n and every successor n of n (generated by any action a), estimated cost of reaching the goal from n is no greater than the stop cost of getting to n plus estimated cost of reaching the goal from n : h(n) c(n, a, n ) + h(n ). This is a form of general triangle inequality: each side of a triangle cannot be longer than sum of two other sides. (KA AGH) spring / 70

63 Greedy best-rst search Only takes into account the heuristic, e.g. f (n) = h(n). Arad 366 (KA AGH) spring / 70

64 Greedy best-rst search Only takes into account the heuristic, e.g. f (n) = h(n). Arad Sibiu Timisoara Zerind (KA AGH) spring / 70

65 Greedy best-rst search Only takes into account the heuristic, e.g. f (n) = h(n). Arad Sibiu Timisoara 329 Zerind 374 Arad Fagaras Oradea Rimnicu Vilcea (KA AGH) spring / 70

66 Greedy best-rst search Only takes into account the heuristic, e.g. f (n) = h(n). Arad Sibiu Timisoara Zerind Arad Fagaras Oradea Rimnicu Vilcea Sibiu Bucharest (KA AGH) spring / 70

67 properties Completeness: No can get stuck in loops. Time complexity: O(b m ), but depends on quality of heuristic. Space complexity: O(b m ) keeps all nodes in memory. Optimality: No. (KA AGH) spring / 70

68 algorithm Idea: avoid expanding paths that are already expensive. f (n) = g(n) + h(n), where: g(n) cost so far to reach n, h(n) estimated cost from n to goal (heuristic), therefore f (n) estimated total cost of path through n to goal. Arad 366=0+366 (KA AGH) spring / 70

69 algorithm Idea: avoid expanding paths that are already expensive. f (n) = g(n) + h(n), where: g(n) cost so far to reach n, h(n) estimated cost from n to goal (heuristic), therefore f (n) estimated total cost of path through n to goal. Sibiu 393= Arad Timisoara Zerind 447= = (KA AGH) spring / 70

70 algorithm Idea: avoid expanding paths that are already expensive. f (n) = g(n) + h(n), where: g(n) cost so far to reach n, h(n) estimated cost from n to goal (heuristic), therefore Arad f (n) estimated total cost of path through n to goal. Fagaras Sibiu Oradea Rimnicu Vilcea 646= = = = Arad Timisoara Zerind 447= = (KA AGH) spring / 70

71 algorithm Idea: avoid expanding paths that are already expensive. f (n) = g(n) + h(n), where: g(n) cost so far to reach n, h(n) estimated cost from n to goal (heuristic), therefore Arad f (n) estimated total cost of path through n to goal. Fagaras Sibiu Oradea 646= = = Rimnicu Vilcea Arad Timisoara Craiova Pitesti Sibiu 526= = = Zerind 447= = (KA AGH) spring / 70

72 algorithm Idea: avoid expanding paths that are already expensive. f (n) = g(n) + h(n), where: g(n) cost so far to reach n, h(n) estimated cost from n to goal (heuristic), therefore Arad 646= Sibiu f (n) estimated total cost of path through n to goal. Fagaras Sibiu Bucharest Oradea 671= Rimnicu Vilcea Arad Timisoara Craiova Pitesti Sibiu 591= = = = = Zerind 447= = (KA AGH) spring / 70

73 algorithm Idea: avoid expanding paths that are already expensive. f (n) = g(n) + h(n), where: g(n) cost so far to reach n, h(n) estimated cost from n to goal (heuristic), therefore Arad 646= Sibiu f (n) estimated total cost of path through n to goal. Fagaras Sibiu Bucharest Oradea 671= Rimnicu Vilcea Arad Timisoara Craiova Pitesti Sibiu 591= = = = Zerind 447= = Bucharest Craiova Rimnicu Vilcea 418= = = (KA AGH) spring / 70

74 Let's suppose that... A* optimality...a suboptimal goal G 2 has been generated. Let n be an unexpanded node on a shortest path to the optimal goal G. Proof G n Start f (G 2 ) = g(g 2 ), since h(g 2 ) = 0 g(g 2 ) > g(g), since G 2 is suboptimal g(g) f (n), since h is admissible Since f (G 2 ) > f (n), A* will never select G 2 for expansion G 2 (KA AGH) spring / 70

75 A* with consistent heuristic Node expansion order If the heuristic is consistent, A* expands nodes in order of increasing f value. A* gradually adds f -contours of nodes; contour i has all nodes with f = f i, where f i < f i+1. A T Z 380 O D L M 400 S R C F P 420 G N B I U V H E (KA AGH) spring / 70

76 A* with inconsistent heuristic If h is inconsistent: As we go along the path, f may sometimes increase. A* doesn't always expand nodes in order of increasing f value, as it may nd lower-cost paths to nodes it already expanded. A* should re-expand those nodes; however, the algorithm will not re-expand them. This example is due to Prof. Dana Nau. (KA AGH) spring / 70

77 A* with inconsistent heuristic If h is inconsistent: As we go along the path, f may sometimes increase. A* doesn't always expand nodes in order of increasing f value, as it may nd lower-cost paths to nodes it already expanded. A* should re-expand those nodes; however, the algorithm will not re-expand them. This example is due to Prof. Dana Nau. (KA AGH) spring / 70

78 A* with inconsistent heuristic If h is inconsistent: As we go along the path, f may sometimes increase. A* doesn't always expand nodes in order of increasing f value, as it may nd lower-cost paths to nodes it already expanded. A* should re-expand those nodes; however, the algorithm will not re-expand them. This example is due to Prof. Dana Nau. (KA AGH) spring / 70

79 A* with inconsistent heuristic If h is inconsistent: As we go along the path, f may sometimes increase. A* doesn't always expand nodes in order of increasing f value, as it may nd lower-cost paths to nodes it already expanded. A* should re-expand those nodes; however, the algorithm will not re-expand them. This example is due to Prof. Dana Nau. (KA AGH) spring / 70

80 A* with inconsistent heuristic If h is inconsistent: As we go along the path, f may sometimes increase. A* doesn't always expand nodes in order of increasing f value, as it may nd lower-cost paths to nodes it already expanded. A* should re-expand those nodes; however, the algorithm will not re-expand them. This example is due to Prof. Dana Nau. (KA AGH) spring / 70

81 A* with inconsistent heuristic If h is inconsistent: As we go along the path, f may sometimes increase. A* doesn't always expand nodes in order of increasing f value, as it may nd lower-cost paths to nodes it already expanded. A* should re-expand those nodes; however, the algorithm will not re-expand them. This example is due to Prof. Dana Nau. (KA AGH) spring / 70

82 Properties of A* A* properties Completeness: Yes, unless there are innitely many nodes with f < f (G). Time complexity: Exponential, depends on mean relative error of heuristic. Space complexity: Keeps all nodes in memory. Optimality: Yes, if: for, the heuristic is admissible, for, the heuristic is admissible and consistent. (KA AGH) spring / 70

83 Heuristic function quality Heuristic functions An admissible heuristic never overestimates the cost of reaching the goal. It usually underestimates see the SLD heuristic. However, a good heuristic function tries to minimise the gap between its value and the actual cost. Example How would you design a heuristic for the 8-puzzle? Start State Goal State (KA AGH) spring / 70

84 Example Heuristic functions How would you design a heuristic for the 8-puzzle? Start State 8-puzzle: two possible heuristics Goal State h 1 (n): number of tiles not in their places h 2 (n): sum of Manhattan distances of all tiles from their places (KA AGH) spring / 70

85 Heuristic functions Example How would you design a heuristic for the 8-puzzle? Start State Goal State 8-puzzle: two possible heuristics h 1 (S) = 6 h 2 (S) = = 14 (KA AGH) spring / 70

86 Heuristic functions 8-puzzle: two possible heuristics h 1 (S) = 6 h 2 (S) = = 14 Heuristic domination If h 2 (n) h 1 (n) for all n, then h 2 dominates h 1. Therefore, h 2 is always better than h 1. Performance comparison Number of nodes expanded if solution is at depth d: d A*(h 1 ) A*(h 2 ) (KA AGH) spring / 70

87 Heuristic domination Heuristic functions If h 2 (n) h 1 (n) for all n, then h 2 dominates h 1. Therefore, h 2 is always better than h 1. Hybrid heuristics If h a and h b are admissible heuristics, then h(n) = max(h a (n), h b (n)) is admissible and dominates both h a and h b. Deriving admissible heuristics Admissible heuristics can be derived from the exact solution cost of a relaxed version of the problem. (KA AGH) spring / 70

88 Deriving admissible heuristics Heuristic functions Admissible heuristics can be derived from the exact solution cost of a relaxed version of the problem. Example: 8-puzzle For the 8-puzzle problem: If the rules are relaxed so that a tile can move anywhere, then h 1 (n) (number of misplaced tiles) gives the exact cost. If the rules are relaxed so that a tile can can move to any adjacent square (regardless of whether it's occupied), then h 2 (n) (sum of Manhattan distances) gives the exact cost Start State Goal State (KA AGH) spring / 70

89 For many problems, the solution is important, not how we got there the path is irrelevant. State space: set of complete congurations; nd optimal conguration (e.g., TSP) or conguration satisfying constraints (e.g., timetable). : keep current state, try to improve it. Example: Travelling Salesman Problem Start with any complete tour, then try to switch pairs. (KA AGH) spring / 70

90 Example: n-queensexample: n-queens Put nput queens n queens on an n on an n board n n with board no two so that queens noontwo thequeens same row, column, conictor ondiagonal same row, column or diagonal. Move a queen to reduce number of conicts. Move a queen to reduce number of conflicts h = 5 h = 2 h = 0 Almost always solves n-queens problems almost instantaneously for very large n, e.g., n = 1million (KA AGH) spring / 70

91 search ascent/descent search (or gradient ascent/descent) Also called local greedy search. Like climbing Mt. Everest in thick fog, with amnesia. Like climbing Everest in thick fog with amnesia function Hill-Climbing( problem) returns a state that is a local maximum inputs: problem, a problem local variables: current, a node neighbor, a node current Make-Node(Initial-State[problem]) loop do neighbor a highest-valued successor of current if Value[neighbor] Value[current] then return State[current] current neighbor end (KA AGH) spring / 70

92 objective function shoulder search global maximum current state algorithm can get stuck on: local maxima, ridges, ats. local maximum "flat" local maximum state space (KA AGH) spring / 70

93 search Variants of hill-climbing search If an algorithm (e.g., `standard' hill-climbing) only selects moves which improve the solution, it is bound to be incomplete. Random-start are complete, but very ineective. Stochastic hill-climbing picks one of the better successors at random. First-choice hill-climbing generates random successors until it nds one better than the current state. Random-restart hill-climbing conducts a series of searches, starting with random start states. It is complete with probability close to 1, because it must eventually generate the goal state. (KA AGH) spring / 70

94 Background Simulated annealing In metallurgy, annealing is the process used to temper or harden metals and glass by heating them to a high temperature and then gradually cool them. This allows the material to coalesce into a low-energy crystalline state. The algorithm Selects move at random. If the move improves the solution, it is made every time. If the move worsens the solution, the probability if it is made is determined upon: the amount E by which the solution is worsened, the so-called temperature T, which is decreased in every iteration. a a That way, the bad moves are more likely to be allowed at the start, and become less likely as the temperature decreases. (KA AGH) spring / 70

95 Simulated annealing Simulated annealing Idea: escape local maxima by allowing some bad moves but gradually decrease their size and frequency function Simulated-Annealing( problem, schedule) returns a solution state inputs: problem, a problem schedule, a mapping from time to temperature local variables: current, a node next, a node T, a temperature controlling prob. of downward steps current Make-Node(Initial-State[problem]) for t 1 to do T schedule[t] if T = 0 then return current next a randomly selected successor of current E Value[next] Value[current] if E > 0 then current next else current next only with probability e E/T Chapter 4, Sections (KA AGH) spring / 70

96 Local beam search Local beam search Idea: keep k states instead of 1; choose top k of all their successors. Problem Not the same as k individual searches run in parallel. Searches that nd good states invite others to join them. Threads that do not provide good results are discarded. Often, all k states end up on same local maximum. Solution: stochastic local beam search Choose k successors at random, but still be biased towards the good ones. (KA AGH) spring / 70

97 Genetic Genetic Variant of stochastic beam search. Successor states generated by combining two parent states (rather than modifying a single state). We have k randomly generated states, called the population. Each state is caled an individual. Each individual is represented as a string over a nite alphabet. Steps in GA 1 Evaluate tness of each individual in population, as probability of being selected for reproduction. 2 Perform selection, taking tness into account. 3 Perform crossover within pairs (at random point). 4 Introduce random mutation to allow for stochastic exploration. (KA AGH) spring / 70

98 Genetic Fitness 31% 29% 26% 14% Selection Pairs Cross Over Mutation + = (KA AGH) spring / 70

99 Lecture Plan 1 2 Graph as a model of the Search Space 3 Blind search strategies 4 Informed search strategies 5 (KA AGH) spring / 70

100 (KA AGH) spring / 70

Informed search algorithms. Chapter 4, Sections 1 2 1

Informed search algorithms. Chapter 4, Sections 1 2 1 Informed search algorithms Chapter 4, Sections 1 2 Chapter 4, Sections 1 2 1 Outline Best-first search A search Heuristics Chapter 4, Sections 1 2 2 Review: Tree search function Tree-Search( problem, fringe)

More information

AI: A Modern Approach, Chpts. 3-4 Russell and Norvig

AI: A Modern Approach, Chpts. 3-4 Russell and Norvig AI: A Modern Approach, Chpts. 3-4 Russell and Norvig Sequential Decision Making in Robotics CS 599 Geoffrey Hollinger and Gaurav Sukhatme (Some slide content from Stuart Russell and HweeTou Ng) Spring,

More information

Problem solving and search

Problem solving and search Problem solving and search hapter 3 hapter 3 1 eminders ssignment 0 due 5pm today ssignment 1 posted, due 2/9 ection 105 will move to 9-10am starting next week hapter 3 2 Outline Problem-solving agents

More information

CS91.543 MidTerm Exam 4/1/2004 Name: KEY. Page Max Score 1 18 2 11 3 30 4 15 5 45 6 20 Total 139

CS91.543 MidTerm Exam 4/1/2004 Name: KEY. Page Max Score 1 18 2 11 3 30 4 15 5 45 6 20 Total 139 CS91.543 MidTerm Exam 4/1/2004 Name: KEY Page Max Score 1 18 2 11 3 30 4 15 5 45 6 20 Total 139 % INTRODUCTION, AI HISTORY AND AGENTS 1. [4 pts. ea.] Briefly describe the following important AI programs.

More information

Smart Graphics: Methoden 3 Suche, Constraints

Smart Graphics: Methoden 3 Suche, Constraints Smart Graphics: Methoden 3 Suche, Constraints Vorlesung Smart Graphics LMU München Medieninformatik Butz/Boring Smart Graphics SS2007 Methoden: Suche 2 Folie 1 Themen heute Suchverfahren Hillclimbing Simulated

More information

Measuring the Performance of an Agent

Measuring the Performance of an Agent 25 Measuring the Performance of an Agent The rational agent that we are aiming at should be successful in the task it is performing To assess the success we need to have a performance measure What is rational

More information

SOLVING PROBLEMS BY SEARCHING

SOLVING PROBLEMS BY SEARCHING 3 SOLVING PROBLEMS BY SEARCHING In which we see how an agent can find a sequence of actions that achieves its goals, when no single action will do. PROBLEM SOLVING AGENT The simplest agents discussed in

More information

CMPSCI611: Approximating MAX-CUT Lecture 20

CMPSCI611: Approximating MAX-CUT Lecture 20 CMPSCI611: Approximating MAX-CUT Lecture 20 For the next two lectures we ll be seeing examples of approximation algorithms for interesting NP-hard problems. Today we consider MAX-CUT, which we proved to

More information

Search methods motivation 1

Search methods motivation 1 Suppose you are an independent software developer, and your software package Windows Defeater R, widely available on sourceforge under a GNU GPL license, is getting an international attention and acclaim.

More information

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits Outline NP-completeness Examples of Easy vs. Hard problems Euler circuit vs. Hamiltonian circuit Shortest Path vs. Longest Path 2-pairs sum vs. general Subset Sum Reducing one problem to another Clique

More information

Guessing Game: NP-Complete?

Guessing Game: NP-Complete? Guessing Game: NP-Complete? 1. LONGEST-PATH: Given a graph G = (V, E), does there exists a simple path of length at least k edges? YES 2. SHORTEST-PATH: Given a graph G = (V, E), does there exists a simple

More information

Problem Set 7 Solutions

Problem Set 7 Solutions 8 8 Introduction to Algorithms May 7, 2004 Massachusetts Institute of Technology 6.046J/18.410J Professors Erik Demaine and Shafi Goldwasser Handout 25 Problem Set 7 Solutions This problem set is due in

More information

Approximation Algorithms

Approximation Algorithms Approximation Algorithms or: How I Learned to Stop Worrying and Deal with NP-Completeness Ong Jit Sheng, Jonathan (A0073924B) March, 2012 Overview Key Results (I) General techniques: Greedy algorithms

More information

Social Media Mining. Graph Essentials

Social Media Mining. Graph Essentials Graph Essentials Graph Basics Measures Graph and Essentials Metrics 2 2 Nodes and Edges A network is a graph nodes, actors, or vertices (plural of vertex) Connections, edges or ties Edge Node Measures

More information

An Introduction to The A* Algorithm

An Introduction to The A* Algorithm An Introduction to The A* Algorithm Introduction The A* (A-Star) algorithm depicts one of the most popular AI methods used to identify the shortest path between 2 locations in a mapped area. The A* algorithm

More information

Lecture 3. Linear Programming. 3B1B Optimization Michaelmas 2015 A. Zisserman. Extreme solutions. Simplex method. Interior point method

Lecture 3. Linear Programming. 3B1B Optimization Michaelmas 2015 A. Zisserman. Extreme solutions. Simplex method. Interior point method Lecture 3 3B1B Optimization Michaelmas 2015 A. Zisserman Linear Programming Extreme solutions Simplex method Interior point method Integer programming and relaxation The Optimization Tree Linear Programming

More information

Y. Xiang, Constraint Satisfaction Problems

Y. Xiang, Constraint Satisfaction Problems Constraint Satisfaction Problems Objectives Constraint satisfaction problems Backtracking Iterative improvement Constraint propagation Reference Russell & Norvig: Chapter 5. 1 Constraints Constraints are

More information

IE 680 Special Topics in Production Systems: Networks, Routing and Logistics*

IE 680 Special Topics in Production Systems: Networks, Routing and Logistics* IE 680 Special Topics in Production Systems: Networks, Routing and Logistics* Rakesh Nagi Department of Industrial Engineering University at Buffalo (SUNY) *Lecture notes from Network Flows by Ahuja, Magnanti

More information

Integer Programming: Algorithms - 3

Integer Programming: Algorithms - 3 Week 9 Integer Programming: Algorithms - 3 OPR 992 Applied Mathematical Programming OPR 992 - Applied Mathematical Programming - p. 1/12 Dantzig-Wolfe Reformulation Example Strength of the Linear Programming

More information

Analysis of Algorithms, I

Analysis of Algorithms, I Analysis of Algorithms, I CSOR W4231.002 Eleni Drinea Computer Science Department Columbia University Thursday, February 26, 2015 Outline 1 Recap 2 Representing graphs 3 Breadth-first search (BFS) 4 Applications

More information

Home Page. Data Structures. Title Page. Page 1 of 24. Go Back. Full Screen. Close. Quit

Home Page. Data Structures. Title Page. Page 1 of 24. Go Back. Full Screen. Close. Quit Data Structures Page 1 of 24 A.1. Arrays (Vectors) n-element vector start address + ielementsize 0 +1 +2 +3 +4... +n-1 start address continuous memory block static, if size is known at compile time dynamic,

More information

Lecture. Simulation and optimization

Lecture. Simulation and optimization Course Simulation Lecture Simulation and optimization 1 4/3/2015 Simulation and optimization Platform busses at Schiphol Optimization: Find a feasible assignment of bus trips to bus shifts (driver and

More information

A Review And Evaluations Of Shortest Path Algorithms

A Review And Evaluations Of Shortest Path Algorithms A Review And Evaluations Of Shortest Path Algorithms Kairanbay Magzhan, Hajar Mat Jani Abstract: Nowadays, in computer networks, the routing is based on the shortest path problem. This will help in minimizing

More information

Introduction Solvability Rules Computer Solution Implementation. Connect Four. March 9, 2010. Connect Four

Introduction Solvability Rules Computer Solution Implementation. Connect Four. March 9, 2010. Connect Four March 9, 2010 is a tic-tac-toe like game in which two players drop discs into a 7x6 board. The first player to get four in a row (either vertically, horizontally, or diagonally) wins. The game was first

More information

Dynamic Programming. Lecture 11. 11.1 Overview. 11.2 Introduction

Dynamic Programming. Lecture 11. 11.1 Overview. 11.2 Introduction Lecture 11 Dynamic Programming 11.1 Overview Dynamic Programming is a powerful technique that allows one to solve many different types of problems in time O(n 2 ) or O(n 3 ) for which a naive approach

More information

Genetic Algorithms and Sudoku

Genetic Algorithms and Sudoku Genetic Algorithms and Sudoku Dr. John M. Weiss Department of Mathematics and Computer Science South Dakota School of Mines and Technology (SDSM&T) Rapid City, SD 57701-3995 john.weiss@sdsmt.edu MICS 2009

More information

Part 2: Community Detection

Part 2: Community Detection Chapter 8: Graph Data Part 2: Community Detection Based on Leskovec, Rajaraman, Ullman 2014: Mining of Massive Datasets Big Data Management and Analytics Outline Community Detection - Social networks -

More information

So today we shall continue our discussion on the search engines and web crawlers. (Refer Slide Time: 01:02)

So today we shall continue our discussion on the search engines and web crawlers. (Refer Slide Time: 01:02) Internet Technology Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture No #39 Search Engines and Web Crawler :: Part 2 So today we

More information

Why? A central concept in Computer Science. Algorithms are ubiquitous.

Why? A central concept in Computer Science. Algorithms are ubiquitous. Analysis of Algorithms: A Brief Introduction Why? A central concept in Computer Science. Algorithms are ubiquitous. Using the Internet (sending email, transferring files, use of search engines, online

More information

Inteligencia Artificial Representación del conocimiento a través de restricciones (continuación)

Inteligencia Artificial Representación del conocimiento a través de restricciones (continuación) Inteligencia Artificial Representación del conocimiento a través de restricciones (continuación) Gloria Inés Alvarez V. Pontifica Universidad Javeriana Cali Periodo 2014-2 Material de David L. Poole and

More information

Load Planning for Less-than-truckload Carriers. Martin Savelsbergh

Load Planning for Less-than-truckload Carriers. Martin Savelsbergh Load Planning for Less-than-truckload Carriers Martin Savelsbergh Centre for Optimal Planning and Operations School of Mathematical and Physical Sciences University of Newcastle Optimisation in Industry,

More information

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. !-approximation algorithm.

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. !-approximation algorithm. Approximation Algorithms Chapter Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of

More information

Topology-based network security

Topology-based network security Topology-based network security Tiit Pikma Supervised by Vitaly Skachek Research Seminar in Cryptography University of Tartu, Spring 2013 1 Introduction In both wired and wireless networks, there is the

More information

Design and Analysis of ACO algorithms for edge matching problems

Design and Analysis of ACO algorithms for edge matching problems Design and Analysis of ACO algorithms for edge matching problems Carl Martin Dissing Söderlind Kgs. Lyngby 2010 DTU Informatics Department of Informatics and Mathematical Modelling Technical University

More information

DATA ANALYSIS II. Matrix Algorithms

DATA ANALYSIS II. Matrix Algorithms DATA ANALYSIS II Matrix Algorithms Similarity Matrix Given a dataset D = {x i }, i=1,..,n consisting of n points in R d, let A denote the n n symmetric similarity matrix between the points, given as where

More information

Chapter 13: Binary and Mixed-Integer Programming

Chapter 13: Binary and Mixed-Integer Programming Chapter 3: Binary and Mixed-Integer Programming The general branch and bound approach described in the previous chapter can be customized for special situations. This chapter addresses two special situations:

More information

Computer Algorithms. NP-Complete Problems. CISC 4080 Yanjun Li

Computer Algorithms. NP-Complete Problems. CISC 4080 Yanjun Li Computer Algorithms NP-Complete Problems NP-completeness The quest for efficient algorithms is about finding clever ways to bypass the process of exhaustive search, using clues from the input in order

More information

Course Outline Department of Computing Science Faculty of Science. COMP 3710-3 Applied Artificial Intelligence (3,1,0) Fall 2015

Course Outline Department of Computing Science Faculty of Science. COMP 3710-3 Applied Artificial Intelligence (3,1,0) Fall 2015 Course Outline Department of Computing Science Faculty of Science COMP 710 - Applied Artificial Intelligence (,1,0) Fall 2015 Instructor: Office: Phone/Voice Mail: E-Mail: Course Description : Students

More information

Example Problems. Channel Routing. Lots of Chip Real-estate. Same connectivity, much less space. Slide 1. Slide 2

Example Problems. Channel Routing. Lots of Chip Real-estate. Same connectivity, much less space. Slide 1. Slide 2 Iterative Improvement Search Hill Climbing, Simulated Annealing, WALKSAT, and Genetic Algorithms Andrew W. Moore Professor School of Computer Science Carnegie Mellon University www.cs.cmu.edu/~awm awm@cs.cmu.edu

More information

Graph Theory Problems and Solutions

Graph Theory Problems and Solutions raph Theory Problems and Solutions Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles November, 005 Problems. Prove that the sum of the degrees of the vertices of any finite graph is

More information

Introduction to Logic in Computer Science: Autumn 2006

Introduction to Logic in Computer Science: Autumn 2006 Introduction to Logic in Computer Science: Autumn 2006 Ulle Endriss Institute for Logic, Language and Computation University of Amsterdam Ulle Endriss 1 Plan for Today Now that we have a basic understanding

More information

Kenken For Teachers. Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles June 27, 2010. Abstract

Kenken For Teachers. Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles June 27, 2010. Abstract Kenken For Teachers Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles June 7, 00 Abstract Kenken is a puzzle whose solution requires a combination of logic and simple arithmetic skills.

More information

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. #-approximation algorithm.

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. #-approximation algorithm. Approximation Algorithms 11 Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of three

More information

6.02 Practice Problems: Routing

6.02 Practice Problems: Routing 1 of 9 6.02 Practice Problems: Routing IMPORTANT: IN ADDITION TO THESE PROBLEMS, PLEASE SOLVE THE PROBLEMS AT THE END OF CHAPTERS 17 AND 18. Problem 1. Consider the following networks: network I (containing

More information

A Systematic Approach to Model-Guided Empirical Search for Memory Hierarchy Optimization

A Systematic Approach to Model-Guided Empirical Search for Memory Hierarchy Optimization A Systematic Approach to Model-Guided Empirical Search for Memory Hierarchy Optimization Chun Chen, Jacqueline Chame, Mary Hall, and Kristina Lerman University of Southern California/Information Sciences

More information

Mining Social Network Graphs

Mining Social Network Graphs Mining Social Network Graphs Debapriyo Majumdar Data Mining Fall 2014 Indian Statistical Institute Kolkata November 13, 17, 2014 Social Network No introduc+on required Really? We s7ll need to understand

More information

Binary Search Trees. A Generic Tree. Binary Trees. Nodes in a binary search tree ( B-S-T) are of the form. P parent. Key. Satellite data L R

Binary Search Trees. A Generic Tree. Binary Trees. Nodes in a binary search tree ( B-S-T) are of the form. P parent. Key. Satellite data L R Binary Search Trees A Generic Tree Nodes in a binary search tree ( B-S-T) are of the form P parent Key A Satellite data L R B C D E F G H I J The B-S-T has a root node which is the only node whose parent

More information

Genetic programming with regular expressions

Genetic programming with regular expressions Genetic programming with regular expressions Børge Svingen Chief Technology Officer, Open AdExchange bsvingen@openadex.com 2009-03-23 Pattern discovery Pattern discovery: Recognizing patterns that characterize

More information

Optimization of Cable Cycles: A Trade-off between Reliability and Cost

Optimization of Cable Cycles: A Trade-off between Reliability and Cost Optimization of Cable Cycles: A Trade-off between Reliability and Cost Master Thesis in Micro-data Analysis Author: Barsam Payvar Supervisors: Hasan Fleyeh Pascal Rebreyend March 2014 Business Intelligence

More information

Martin Savelsbergh. Georgia Institute of Technology. Joint work with Alan Erera, Mike Hewitt, Yang Zhang

Martin Savelsbergh. Georgia Institute of Technology. Joint work with Alan Erera, Mike Hewitt, Yang Zhang Dynamic Load Planning for Less-Than-Truckload Carriers Schneider Professor Georgia Institute of Technology Joint work with Alan Erera, Mike Hewitt, Yang Zhang TRANSLOG, December 10, 2009 Part I: Advances

More information

INTEGER PROGRAMMING. Integer Programming. Prototype example. BIP model. BIP models

INTEGER PROGRAMMING. Integer Programming. Prototype example. BIP model. BIP models Integer Programming INTEGER PROGRAMMING In many problems the decision variables must have integer values. Example: assign people, machines, and vehicles to activities in integer quantities. If this is

More information

Incremental Routing Algorithms For Dynamic Transportation Networks

Incremental Routing Algorithms For Dynamic Transportation Networks UCGE Reports Number 20238 Department of Geomatics Engineering Incremental Routing Algorithms For Dynamic Transportation Networks (URL: http://www.geomatics.ucalgary.ca/research/publications/gradtheses.html)

More information

PARALLELIZED SUDOKU SOLVING ALGORITHM USING OpenMP

PARALLELIZED SUDOKU SOLVING ALGORITHM USING OpenMP PARALLELIZED SUDOKU SOLVING ALGORITHM USING OpenMP Sruthi Sankar CSE 633: Parallel Algorithms Spring 2014 Professor: Dr. Russ Miller Sudoku: the puzzle A standard Sudoku puzzles contains 81 grids :9 rows

More information

Chapter 11. 11.1 Load Balancing. Approximation Algorithms. Load Balancing. Load Balancing on 2 Machines. Load Balancing: Greedy Scheduling

Chapter 11. 11.1 Load Balancing. Approximation Algorithms. Load Balancing. Load Balancing on 2 Machines. Load Balancing: Greedy Scheduling Approximation Algorithms Chapter Approximation Algorithms Q. Suppose I need to solve an NP-hard problem. What should I do? A. Theory says you're unlikely to find a poly-time algorithm. Must sacrifice one

More information

Memory Allocation Technique for Segregated Free List Based on Genetic Algorithm

Memory Allocation Technique for Segregated Free List Based on Genetic Algorithm Journal of Al-Nahrain University Vol.15 (2), June, 2012, pp.161-168 Science Memory Allocation Technique for Segregated Free List Based on Genetic Algorithm Manal F. Younis Computer Department, College

More information

On the effect of forwarding table size on SDN network utilization

On the effect of forwarding table size on SDN network utilization IBM Haifa Research Lab On the effect of forwarding table size on SDN network utilization Rami Cohen IBM Haifa Research Lab Liane Lewin Eytan Yahoo Research, Haifa Seffi Naor CS Technion, Israel Danny Raz

More information

Clustering and scheduling maintenance tasks over time

Clustering and scheduling maintenance tasks over time Clustering and scheduling maintenance tasks over time Per Kreuger 2008-04-29 SICS Technical Report T2008:09 Abstract We report results on a maintenance scheduling problem. The problem consists of allocating

More information

International Journal of Advanced Research in Computer Science and Software Engineering

International Journal of Advanced Research in Computer Science and Software Engineering Volume 3, Issue 7, July 23 ISSN: 2277 28X International Journal of Advanced Research in Computer Science and Software Engineering Research Paper Available online at: www.ijarcsse.com Greedy Algorithm:

More information

Data Structures and Algorithms Written Examination

Data Structures and Algorithms Written Examination Data Structures and Algorithms Written Examination 22 February 2013 FIRST NAME STUDENT NUMBER LAST NAME SIGNATURE Instructions for students: Write First Name, Last Name, Student Number and Signature where

More information

Chapter 6: Graph Theory

Chapter 6: Graph Theory Chapter 6: Graph Theory Graph theory deals with routing and network problems and if it is possible to find a best route, whether that means the least expensive, least amount of time or the least distance.

More information

Lecture 1: Systems of Linear Equations

Lecture 1: Systems of Linear Equations MTH Elementary Matrix Algebra Professor Chao Huang Department of Mathematics and Statistics Wright State University Lecture 1 Systems of Linear Equations ² Systems of two linear equations with two variables

More information

2. (a) Explain the strassen s matrix multiplication. (b) Write deletion algorithm, of Binary search tree. [8+8]

2. (a) Explain the strassen s matrix multiplication. (b) Write deletion algorithm, of Binary search tree. [8+8] Code No: R05220502 Set No. 1 1. (a) Describe the performance analysis in detail. (b) Show that f 1 (n)+f 2 (n) = 0(max(g 1 (n), g 2 (n)) where f 1 (n) = 0(g 1 (n)) and f 2 (n) = 0(g 2 (n)). [8+8] 2. (a)

More information

Analysis of Micromouse Maze Solving Algorithms

Analysis of Micromouse Maze Solving Algorithms 1 Analysis of Micromouse Maze Solving Algorithms David M. Willardson ECE 557: Learning from Data, Spring 2001 Abstract This project involves a simulation of a mouse that is to find its way through a maze.

More information

Lecture 10: Regression Trees

Lecture 10: Regression Trees Lecture 10: Regression Trees 36-350: Data Mining October 11, 2006 Reading: Textbook, sections 5.2 and 10.5. The next three lectures are going to be about a particular kind of nonlinear predictive model,

More information

Genetic Algorithm. Based on Darwinian Paradigm. Intrinsically a robust search and optimization mechanism. Conceptual Algorithm

Genetic Algorithm. Based on Darwinian Paradigm. Intrinsically a robust search and optimization mechanism. Conceptual Algorithm 24 Genetic Algorithm Based on Darwinian Paradigm Reproduction Competition Survive Selection Intrinsically a robust search and optimization mechanism Slide -47 - Conceptual Algorithm Slide -48 - 25 Genetic

More information

Stochastic Local Search Algorithms

Stochastic Local Search Algorithms Stochastic Local Search Algorithms Alan Mackworth UBC CS 322 CSP 7 February 8, 2013 Textbook 4.8 Lecture Overview Announcements Recap: stochastic local search (SLS) Types of SLS algorithms Algorithm configuration

More information

Praktikum Wissenschaftliches Rechnen (Performance-optimized optimized Programming)

Praktikum Wissenschaftliches Rechnen (Performance-optimized optimized Programming) Praktikum Wissenschaftliches Rechnen (Performance-optimized optimized Programming) Dynamic Load Balancing Dr. Ralf-Peter Mundani Center for Simulation Technology in Engineering Technische Universität München

More information

Acquisition Lesson Planning Form Key Standards addressed in this Lesson: MM2A3d,e Time allotted for this Lesson: 4 Hours

Acquisition Lesson Planning Form Key Standards addressed in this Lesson: MM2A3d,e Time allotted for this Lesson: 4 Hours Acquisition Lesson Planning Form Key Standards addressed in this Lesson: MM2A3d,e Time allotted for this Lesson: 4 Hours Essential Question: LESSON 4 FINITE ARITHMETIC SERIES AND RELATIONSHIP TO QUADRATIC

More information

D A T A M I N I N G C L A S S I F I C A T I O N

D A T A M I N I N G C L A S S I F I C A T I O N D A T A M I N I N G C L A S S I F I C A T I O N FABRICIO VOZNIKA LEO NARDO VIA NA INTRODUCTION Nowadays there is huge amount of data being collected and stored in databases everywhere across the globe.

More information

Network (Tree) Topology Inference Based on Prüfer Sequence

Network (Tree) Topology Inference Based on Prüfer Sequence Network (Tree) Topology Inference Based on Prüfer Sequence C. Vanniarajan and Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology Madras Chennai 600036 vanniarajanc@hcl.in,

More information

Applied Algorithm Design Lecture 5

Applied Algorithm Design Lecture 5 Applied Algorithm Design Lecture 5 Pietro Michiardi Eurecom Pietro Michiardi (Eurecom) Applied Algorithm Design Lecture 5 1 / 86 Approximation Algorithms Pietro Michiardi (Eurecom) Applied Algorithm Design

More information

c 2008 Je rey A. Miron We have described the constraints that a consumer faces, i.e., discussed the budget constraint.

c 2008 Je rey A. Miron We have described the constraints that a consumer faces, i.e., discussed the budget constraint. Lecture 2b: Utility c 2008 Je rey A. Miron Outline: 1. Introduction 2. Utility: A De nition 3. Monotonic Transformations 4. Cardinal Utility 5. Constructing a Utility Function 6. Examples of Utility Functions

More information

Arrangements And Duality

Arrangements And Duality Arrangements And Duality 3.1 Introduction 3 Point configurations are tbe most basic structure we study in computational geometry. But what about configurations of more complicated shapes? For example,

More information

Mining Social-Network Graphs

Mining Social-Network Graphs 342 Chapter 10 Mining Social-Network Graphs There is much information to be gained by analyzing the large-scale data that is derived from social networks. The best-known example of a social network is

More information

A hierarchical multicriteria routing model with traffic splitting for MPLS networks

A hierarchical multicriteria routing model with traffic splitting for MPLS networks A hierarchical multicriteria routing model with traffic splitting for MPLS networks João Clímaco, José Craveirinha, Marta Pascoal jclimaco@inesccpt, jcrav@deecucpt, marta@matucpt University of Coimbra

More information

CSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) 3 4 4 7 5 9 6 16 7 8 8 4 9 8 10 4 Total 92.

CSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) 3 4 4 7 5 9 6 16 7 8 8 4 9 8 10 4 Total 92. Name: Email ID: CSE 326, Data Structures Section: Sample Final Exam Instructions: The exam is closed book, closed notes. Unless otherwise stated, N denotes the number of elements in the data structure

More information

Moving Target Search. 204 Automated Reasoning

Moving Target Search. 204 Automated Reasoning Moving Target Search Toru Ishida NTT Communications and Information Processing Laboratories 1-2356, Take, Yokosuka, 238-03, JAPAN ishida%nttkb.ntt.jp@relay.cs.net Richard E. Korf Computer Science Department

More information

Decision Trees from large Databases: SLIQ

Decision Trees from large Databases: SLIQ Decision Trees from large Databases: SLIQ C4.5 often iterates over the training set How often? If the training set does not fit into main memory, swapping makes C4.5 unpractical! SLIQ: Sort the values

More information

Investigating Area Under a Curve

Investigating Area Under a Curve Mathematics Investigating Area Under a Curve About this Lesson This lesson is an introduction to areas bounded by functions and the x-axis on a given interval. Since the functions in the beginning of the

More information

CS 598CSC: Combinatorial Optimization Lecture date: 2/4/2010

CS 598CSC: Combinatorial Optimization Lecture date: 2/4/2010 CS 598CSC: Combinatorial Optimization Lecture date: /4/010 Instructor: Chandra Chekuri Scribe: David Morrison Gomory-Hu Trees (The work in this section closely follows [3]) Let G = (V, E) be an undirected

More information

Patterns in Pascal s Triangle

Patterns in Pascal s Triangle Pascal s Triangle Pascal s Triangle is an infinite triangular array of numbers beginning with a at the top. Pascal s Triangle can be constructed starting with just the on the top by following one easy

More information

Graphs without proper subgraphs of minimum degree 3 and short cycles

Graphs without proper subgraphs of minimum degree 3 and short cycles Graphs without proper subgraphs of minimum degree 3 and short cycles Lothar Narins, Alexey Pokrovskiy, Tibor Szabó Department of Mathematics, Freie Universität, Berlin, Germany. August 22, 2014 Abstract

More information

DEVELOPMENT OF A VULNERABILITY ASSESSMENT CODE FOR A PHYSICAL PROTECTION SYSTEM: SYSTEMATIC ANALYSIS OF PHYSICAL PROTECTION EFFECTIVENESS (SAPE)

DEVELOPMENT OF A VULNERABILITY ASSESSMENT CODE FOR A PHYSICAL PROTECTION SYSTEM: SYSTEMATIC ANALYSIS OF PHYSICAL PROTECTION EFFECTIVENESS (SAPE) DEVELOPMENT OF A VULNERABILITY ASSESSMENT CODE FOR A PHYSICAL PROTECTION SYSTEM: SYSTEMATIC ANALYSIS OF PHYSICAL PROTECTION EFFECTIVENESS (SAPE) SUNG SOON JANG *, SUNG-WOO KWAK, HOSIK YOO, JUNG-SOO KIM

More information

Euler Paths and Euler Circuits

Euler Paths and Euler Circuits Euler Paths and Euler Circuits An Euler path is a path that uses every edge of a graph exactly once. An Euler circuit is a circuit that uses every edge of a graph exactly once. An Euler path starts and

More information

Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs

Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs CSE599s: Extremal Combinatorics November 21, 2011 Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs Lecturer: Anup Rao 1 An Arithmetic Circuit Lower Bound An arithmetic circuit is just like

More information

LABEL PROPAGATION ON GRAPHS. SEMI-SUPERVISED LEARNING. ----Changsheng Liu 10-30-2014

LABEL PROPAGATION ON GRAPHS. SEMI-SUPERVISED LEARNING. ----Changsheng Liu 10-30-2014 LABEL PROPAGATION ON GRAPHS. SEMI-SUPERVISED LEARNING ----Changsheng Liu 10-30-2014 Agenda Semi Supervised Learning Topics in Semi Supervised Learning Label Propagation Local and global consistency Graph

More information

Social Media Mining. Network Measures

Social Media Mining. Network Measures Klout Measures and Metrics 22 Why Do We Need Measures? Who are the central figures (influential individuals) in the network? What interaction patterns are common in friends? Who are the like-minded users

More information

Chapter 6. Decoding. Statistical Machine Translation

Chapter 6. Decoding. Statistical Machine Translation Chapter 6 Decoding Statistical Machine Translation Decoding We have a mathematical model for translation p(e f) Task of decoding: find the translation e best with highest probability Two types of error

More information

521466S Machine Vision Assignment #7 Hough transform

521466S Machine Vision Assignment #7 Hough transform 521466S Machine Vision Assignment #7 Hough transform Spring 2014 In this assignment we use the hough transform to extract lines from images. We use the standard (r, θ) parametrization of lines, lter the

More information

Pathfinding in Computer Games

Pathfinding in Computer Games Pathfinding in Computer Games Ross Graham, Hugh McCabe and Stephen Sheridan School of Informatics and Engineering, Institute of Technology, Blanchardstown ross.graham@itb.ie, hugh.mccabe@itb.ie, stephen.sheridan@itb.ie

More information

Small Maximal Independent Sets and Faster Exact Graph Coloring

Small Maximal Independent Sets and Faster Exact Graph Coloring Small Maximal Independent Sets and Faster Exact Graph Coloring David Eppstein Univ. of California, Irvine Dept. of Information and Computer Science The Exact Graph Coloring Problem: Given an undirected

More information

CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 313]

CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 313] CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 313] File Structures A file is a collection of data stored on mass storage (e.g., disk or tape) Why on mass storage? too big to fit

More information

Common Core Unit Summary Grades 6 to 8

Common Core Unit Summary Grades 6 to 8 Common Core Unit Summary Grades 6 to 8 Grade 8: Unit 1: Congruence and Similarity- 8G1-8G5 rotations reflections and translations,( RRT=congruence) understand congruence of 2 d figures after RRT Dilations

More information

Genetic Algorithms commonly used selection, replacement, and variation operators Fernando Lobo University of Algarve

Genetic Algorithms commonly used selection, replacement, and variation operators Fernando Lobo University of Algarve Genetic Algorithms commonly used selection, replacement, and variation operators Fernando Lobo University of Algarve Outline Selection methods Replacement methods Variation operators Selection Methods

More information

Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar

Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar Complexity Theory IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar Outline Goals Computation of Problems Concepts and Definitions Complexity Classes and Problems Polynomial Time Reductions Examples

More information

Load Balancing. Load Balancing 1 / 24

Load Balancing. Load Balancing 1 / 24 Load Balancing Backtracking, branch & bound and alpha-beta pruning: how to assign work to idle processes without much communication? Additionally for alpha-beta pruning: implementing the young-brothers-wait

More information

Research Paper Business Analytics. Applications for the Vehicle Routing Problem. Jelmer Blok

Research Paper Business Analytics. Applications for the Vehicle Routing Problem. Jelmer Blok Research Paper Business Analytics Applications for the Vehicle Routing Problem Jelmer Blok Applications for the Vehicle Routing Problem Jelmer Blok Research Paper Vrije Universiteit Amsterdam Faculteit

More information

(Refer Slide Time: 2:03)

(Refer Slide Time: 2:03) Control Engineering Prof. Madan Gopal Department of Electrical Engineering Indian Institute of Technology, Delhi Lecture - 11 Models of Industrial Control Devices and Systems (Contd.) Last time we were

More information

Three Effective Top-Down Clustering Algorithms for Location Database Systems

Three Effective Top-Down Clustering Algorithms for Location Database Systems Three Effective Top-Down Clustering Algorithms for Location Database Systems Kwang-Jo Lee and Sung-Bong Yang Department of Computer Science, Yonsei University, Seoul, Republic of Korea {kjlee5435, yang}@cs.yonsei.ac.kr

More information

SIMS 255 Foundations of Software Design. Complexity and NP-completeness

SIMS 255 Foundations of Software Design. Complexity and NP-completeness SIMS 255 Foundations of Software Design Complexity and NP-completeness Matt Welsh November 29, 2001 mdw@cs.berkeley.edu 1 Outline Complexity of algorithms Space and time complexity ``Big O'' notation Complexity

More information