Best-First Minimax Search Richard E
Total Page:16
File Type:pdf, Size:1020Kb
Load more
Recommended publications
-
Adversarial Search
Adversarial Search In which we examine the problems that arise when we try to plan ahead in a world where other agents are planning against us. Outline 1. Games 2. Optimal Decisions in Games 3. Alpha-Beta Pruning 4. Imperfect, Real-Time Decisions 5. Games that include an Element of Chance 6. State-of-the-Art Game Programs 7. Summary 2 Search Strategies for Games • Difference to general search problems deterministic random – Imperfect Information: opponent not deterministic perfect Checkers, Backgammon, – Time: approximate algorithms information Chess, Go Monopoly incomplete Bridge, Poker, ? information Scrabble • Early fundamental results – Algorithm for perfect game von Neumann (1944) • Our terminology: – Approximation through – deterministic, fully accessible evaluation information Zuse (1945), Shannon (1950) Games 3 Games as Search Problems • Justification: Games are • Games as playground for search problems with an serious research opponent • How can we determine the • Imperfection through actions best next step/action? of opponent: possible results... – Cutting branches („pruning“) • Games hard to solve; – Evaluation functions for exhaustive: approximation of utility – Average branching factor function chess: 35 – ≈ 50 steps per player ➞ 10154 nodes in search tree – But “Only” 1040 allowed positions Games 4 Search Problem • 2-player games • Search problem – Player MAX – Initial state – Player MIN • Board, positions, first player – MAX moves first; players – Successor function then take turns • Lists of (move,state)-pairs – Goal test -
Artificial Intelligence Spring 2019 Homework 2: Adversarial Search
Artificial Intelligence Spring 2019 Homework 2: Adversarial Search PROGRAMMING In this assignment, you will create an adversarial search agent to play the 2048-puzzle game. A demo of the game is available here: gabrielecirulli.github.io/2048. I. 2048 As A Two-Player Game II. Choosing a Search Algorithm: Expectiminimax III. Using The Skeleton Code IV. What You Need To Submit V. Important Information VI. Before You Submit I. 2048 As A Two-Player Game 2048 is played on a 4×4 grid with numbered tiles which can slide up, down, left, or right. This game can be modeled as a two player game, in which the computer AI generates a 2- or 4-tile placed randomly on the board, and the player then selects a direction to move the tiles. Note that the tiles move until they either (1) collide with another tile, or (2) collide with the edge of the grid. If two tiles of the same number collide in a move, they merge into a single tile valued at the sum of the two originals. The resulting tile cannot merge with another tile again in the same move. Usually, each role in a two-player games has a similar set of moves to choose from, and similar objectives (e.g. chess). In 2048 however, the player roles are inherently asymmetric, as the Computer AI places tiles and the Player moves them. Adversarial search can still be applied! Using your previous experience with objects, states, nodes, functions, and implicit or explicit search trees, along with our skeleton code, focus on optimizing your player algorithm to solve 2048 as efficiently and consistently as possible. -
Best-First and Depth-First Minimax Search in Practice
Best-First and Depth-First Minimax Search in Practice Aske Plaat, Erasmus University, [email protected] Jonathan Schaeffer, University of Alberta, [email protected] Wim Pijls, Erasmus University, [email protected] Arie de Bruin, Erasmus University, [email protected] Erasmus University, University of Alberta, Department of Computer Science, Department of Computing Science, Room H4-31, P.O. Box 1738, 615 General Services Building, 3000 DR Rotterdam, Edmonton, Alberta, The Netherlands Canada T6G 2H1 Abstract Most practitioners use a variant of the Alpha-Beta algorithm, a simple depth-®rst pro- cedure, for searching minimax trees. SSS*, with its best-®rst search strategy, reportedly offers the potential for more ef®cient search. However, the complex formulation of the al- gorithm and its alleged excessive memory requirements preclude its use in practice. For two decades, the search ef®ciency of ªsmartº best-®rst SSS* has cast doubt on the effectiveness of ªdumbº depth-®rst Alpha-Beta. This paper presents a simple framework for calling Alpha-Beta that allows us to create a variety of algorithms, including SSS* and DUAL*. In effect, we formulate a best-®rst algorithm using depth-®rst search. Expressed in this framework SSS* is just a special case of Alpha-Beta, solving all of the perceived drawbacks of the algorithm. In practice, Alpha-Beta variants typically evaluate less nodes than SSS*. A new instance of this framework, MTD(ƒ), out-performs SSS* and NegaScout, the Alpha-Beta variant of choice by practitioners. 1 Introduction Game playing is one of the classic problems of arti®cial intelligence. -
General Branch and Bound, and Its Relation to A* and AO*
ARTIFICIAL INTELLIGENCE 29 General Branch and Bound, and Its Relation to A* and AO* Dana S. Nau, Vipin Kumar and Laveen Kanal* Laboratory for Pattern Analysis, Computer Science Department, University of Maryland College Park, MD 20742, U.S.A. Recommended by Erik Sandewall ABSTRACT Branch and Bound (B&B) is a problem-solving technique which is widely used for various problems encountered in operations research and combinatorial mathematics. Various heuristic search pro- cedures used in artificial intelligence (AI) are considered to be related to B&B procedures. However, in the absence of any generally accepted terminology for B&B procedures, there have been widely differing opinions regarding the relationships between these procedures and B &B. This paper presents a formulation of B&B general enough to include previous formulations as special cases, and shows how two well-known AI search procedures (A* and AO*) are special cases o,f this general formulation. 1. Introduction A wide class of problems arising in operations research, decision making and artificial intelligence can be (abstractly) stated in the following form: Given a (possibly infinite) discrete set X and a real-valued objective function F whose domain is X, find an optimal element x* E X such that F(x*) = min{F(x) I x ~ X}) Unless there is enough problem-specific knowledge available to obtain the optimum element of the set in some straightforward manner, the only course available may be to enumerate some or all of the elements of X until an optimal element is found. However, the sets X and {F(x) [ x E X} are usually tThis work was supported by NSF Grant ENG-7822159 to the Laboratory for Pattern Analysis at the University of Maryland. -
Adversarial Search (Game)
Adversarial Search CE417: Introduction to Artificial Intelligence Sharif University of Technology Spring 2019 Soleymani “Artificial Intelligence: A Modern Approach”, 3rd Edition, Chapter 5 Most slides have been adopted from Klein and Abdeel, CS188, UC Berkeley. Outline } Game as a search problem } Minimax algorithm } �-� Pruning: ignoring a portion of the search tree } Time limit problem } Cut off & Evaluation function 2 Games as search problems } Games } Adversarial search problems (goals are in conflict) } Competitive multi-agent environments } Games in AI are a specialized kind of games (in the game theory) 3 Adversarial Games 4 Types of Games } Many different kinds of games! } Axes: } Deterministic or stochastic? } One, two, or more players? } Zero sum? } Perfect information (can you see the state)? } Want algorithms for calculating a strategy (policy) which recommends a move from each state 5 Zero-Sum Games } Zero-Sum Games } General Games } Agents have opposite utilities } Agents have independent utilities (values on outcomes) (values on outcomes) } Lets us think of a single value that one } Cooperation, indifference, competition, maximizes and the other minimizes and more are all possible } Adversarial, pure competition } More later on non-zero-sum games 6 Primary assumptions } We start with these games: } Two -player } Tu r n taking } agents act alternately } Zero-sum } agents’ goals are in conflict: sum of utility values at the end of the game is zero or constant } Perfect information } fully observable Examples: Tic-tac-toe, -
Trees, Binary Search Trees, Heaps & Applications Dr. Chris Bourke
Trees Trees, Binary Search Trees, Heaps & Applications Dr. Chris Bourke Department of Computer Science & Engineering University of Nebraska|Lincoln Lincoln, NE 68588, USA [email protected] http://cse.unl.edu/~cbourke 2015/01/31 21:05:31 Abstract These are lecture notes used in CSCE 156 (Computer Science II), CSCE 235 (Dis- crete Structures) and CSCE 310 (Data Structures & Algorithms) at the University of Nebraska|Lincoln. This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License 1 Contents I Trees4 1 Introduction4 2 Definitions & Terminology5 3 Tree Traversal7 3.1 Preorder Traversal................................7 3.2 Inorder Traversal.................................7 3.3 Postorder Traversal................................7 3.4 Breadth-First Search Traversal..........................8 3.5 Implementations & Data Structures.......................8 3.5.1 Preorder Implementations........................8 3.5.2 Inorder Implementation.........................9 3.5.3 Postorder Implementation........................ 10 3.5.4 BFS Implementation........................... 12 3.5.5 Tree Walk Implementations....................... 12 3.6 Operations..................................... 12 4 Binary Search Trees 14 4.1 Basic Operations................................. 15 5 Balanced Binary Search Trees 17 5.1 2-3 Trees...................................... 17 5.2 AVL Trees..................................... 17 5.3 Red-Black Trees.................................. 19 6 Optimal Binary Search Trees 19 7 Heaps 19 -
Parallel Technique for the Metaheuristic Algorithms Using Devoted Local Search and Manipulating the Solutions Space
applied sciences Article Parallel Technique for the Metaheuristic Algorithms Using Devoted Local Search and Manipulating the Solutions Space Dawid Połap 1,* ID , Karolina K˛esik 1, Marcin Wo´zniak 1 ID and Robertas Damaševiˇcius 2 ID 1 Institute of Mathematics, Silesian University of Technology, Kaszubska 23, 44-100 Gliwice, Poland; [email protected] (K.K.); [email protected] (M.W.) 2 Department of Software Engineering, Kaunas University of Technology, Studentu 50, LT-51368, Kaunas, Lithuania; [email protected] * Correspondence: [email protected] Received: 16 December 2017; Accepted: 13 February 2018 ; Published: 16 February 2018 Abstract: The increasing exploration of alternative methods for solving optimization problems causes that parallelization and modification of the existing algorithms are necessary. Obtaining the right solution using the meta-heuristic algorithm may require long operating time or a large number of iterations or individuals in a population. The higher the number, the longer the operation time. In order to minimize not only the time, but also the value of the parameters we suggest three proposition to increase the efficiency of classical methods. The first one is to use the method of searching through the neighborhood in order to minimize the solution space exploration. Moreover, task distribution between threads and CPU cores can affect the speed of the algorithm and therefore make it work more efficiently. The second proposition involves manipulating the solutions space to minimize the number of calculations. In addition, the third proposition is the combination of the previous two. All propositions has been described, tested and analyzed due to the use of various test functions. -
Exploding Offers with Experimental Consumer Goods∗
Exploding Offers with Experimental Consumer Goods∗ Alexander L. Brown Ajalavat Viriyavipart Department of Economics Department of Economics Texas A&M University Texas A&M University Xiaoyuan Wang Department of Economics Texas A&M University August 29, 2014 Abstract Recent theoretical research indicates that search deterrence strategies are generally opti- mal for sellers in consumer goods markets. Yet search deterrence is not always employed in such markets. To understand this incongruity, we develop an experimental market where profit-maximizing strategy dictates sellers should exercise one form of search deterrence, ex- ploding offers. We find that buyers over-reject exploding offers relative to optimal. Sellers underutilize exploding offers relative to optimal play, even conditional on buyer over-rejection. This tendency dissipates when sellers make offers to computerized buyers, suggesting their persistent behavior with human buyers may be due to a preference rather than a miscalculation. Keywords: exploding offer, search deterrence, experimental economics, quantal response equi- librium JEL: C91 D21 L10 M31 ∗We thank the Texas A&M Humanities and Social Science Enhancement of Research Capacity Program for providing generous financial support for our research. We have benefited from comments by Gary Charness, Catherine Eckel, Silvana Krasteva and seminar participants of the 2013 North American Economic Science Association and Southern Economic Association Meetings. Daniel Stephenson and J. Forrest Williams provided invaluable help in conducting the experimental sessions. 1 Introduction One of the first applications of microeconomic theory is to the consumer goods market: basic supply and demand models can often explain transactions in centralized markets quite well. When markets are decentralized, often additional modeling is required to explain the interactions of consumers and producers. -
Adversarial Search (Game Playing)
Artificial Intelligence Adversarial Search (Game Playing) Chapter 5 Adapted from materials by Tim Finin, Marie desJardins, and Charles R. Dyer Outline • Game playing – State of the art and resources – Framework • Game trees – Minimax – Alpha-beta pruning – Adding randomness State of the art • How good are computer game players? – Chess: • Deep Blue beat Gary Kasparov in 1997 • Garry Kasparav vs. Deep Junior (Feb 2003): tie! • Kasparov vs. X3D Fritz (November 2003): tie! – Checkers: Chinook (an AI program with a very large endgame database) is the world champion. Checkers has been solved exactly – it’s a draw! – Go: Computer players are decent, at best – Bridge: “Expert” computer players exist (but no world champions yet!) • Good place to learn more: http://www.cs.ualberta.ca/~games/ Chinook • Chinook is the World Man-Machine Checkers Champion, developed by researchers at the University of Alberta. • It earned this title by competing in human tournaments, winning the right to play for the (human) world championship, and eventually defeating the best players in the world. • Visit http://www.cs.ualberta.ca/~chinook/ to play a version of Chinook over the Internet. • The developers have fully analyzed the game of checkers and have the complete game tree for it. – Perfect play on both sides results in a tie. • “One Jump Ahead: Challenging Human Supremacy in Checkers” Jonathan Schaeffer, University of Alberta (496 pages, Springer. $34.95, 1998). Ratings of human and computer chess champions Typical case • 2-person game • Players alternate moves • Zero-sum: one player’s loss is the other’s gain • Perfect information: both players have access to complete information about the state of the game. -
Learning Near-Optimal Search in a Minimal Explore/Exploit Task
Explore/exploit tradeoff strategies with accumulating resources 1 Explore/exploit tradeoff strategies in a resource accumulation search task [revised/resubmitted to Cognitive Science] Ke Sang1, Peter M. Todd1, Robert L. Goldstone1, and Thomas T. Hills2 1 Cognitive Science Program and Department of Psychological and Brain Sciences, Indiana University Bloomington 2 Department of Psychology, University of Warwick REVISION 7/5/2018 Contact information: Peter M. Todd Indiana University, Cognitive Science Program 1101 E. 10th Street, Bloomington, IN 47405 USA phone: +1 812 855-3914 email: [email protected] Explore/exploit tradeoff strategies with accumulating resources 2 Abstract How, and how well, do people switch between exploration and exploitation to search for and accumulate resources? We study the decision processes underlying such exploration/exploitation tradeoffs by using a novel card selection task. With experience, participants learn to switch appropriately between exploration and exploitation and approach optimal performance. We model participants’ behavior on this task with random, threshold, and sampling strategies, and find that a linear decreasing threshold rule best fits participants’ results. Further evidence that participants use decreasing threshold-based strategies comes from reaction time differences between exploration and exploitation; however, participants themselves report non-decreasing thresholds. Decreasing threshold strategies that “front-load” exploration and switch quickly to exploitation are particularly effective -
CS 561: Artificial Intelligence
CS 561: Artificial Intelligence Instructor: Sofus A. Macskassy, [email protected] TAs: Nadeesha Ranashinghe ([email protected]) William Yeoh ([email protected]) Harris Chiu ([email protected]) Lectures: MW 5:00-6:20pm, OHE 122 / DEN Office hours: By appointment Class page: http://www-rcf.usc.edu/~macskass/CS561-Spring2010/ This class will use http://www.uscden.net/ and class webpage - Up to date information - Lecture notes - Relevant dates, links, etc. Course material: [AIMA] Artificial Intelligence: A Modern Approach, by Stuart Russell and Peter Norvig. (2nd ed) This time: Outline (Adversarial Search – AIMA Ch. 6] Game playing Perfect play ◦ The minimax algorithm ◦ alpha-beta pruning Resource limitations Elements of chance Imperfect information CS561 - Lecture 7 - Macskassy - Spring 2010 2 What kind of games? Abstraction: To describe a game we must capture every relevant aspect of the game. Such as: ◦ Chess ◦ Tic-tac-toe ◦ … Accessible environments: Such games are characterized by perfect information Search: game-playing then consists of a search through possible game positions Unpredictable opponent: introduces uncertainty thus game-playing must deal with contingency problems CS561 - Lecture 7 - Macskassy - Spring 2010 3 Searching for the next move Complexity: many games have a huge search space ◦ Chess: b = 35, m=100 nodes = 35 100 if each node takes about 1 ns to explore then each move will take about 10 50 millennia to calculate. Resource (e.g., time, memory) limit: optimal solution not feasible/possible, thus must approximate 1. Pruning: makes the search more efficient by discarding portions of the search tree that cannot improve quality result. 2. Evaluation functions: heuristics to evaluate utility of a state without exhaustive search. -
Optimal Symmetric Rendezvous Search on Three Locations
Optimal Symmetric Rendezvous Search on Three Locations Richard Weber Centre for Mathematical Sciences, Wilberforce Road, Cambridge CB2 0WB email: [email protected] www.statslab.cam.ac.uk/~rrw1 In the symmetric rendezvous search game played on n locations two players are initially placed at two distinct locations. The game is played in discrete steps, at each of which each player can either stay where he is or move to a different location. The players share no common labelling of the locations. We wish to find a strategy such that, if both players follow it independently, then the expected number of steps until they are in the same location is minimized. Informal versions of the rendezvous problem have received considerable attention in the popular press. The problem was proposed by Steve Alpern in 1976 and it has proved notoriously difficult to analyse. In this paper we prove a 20 year old conjecture that the following strategy is optimal for the game on three locations: in each block of two steps, stay where you, or search the other two locations in random order, doing these with probabilities 1=3 and 2=3 respectively. This is now the first nontrivial symmetric rendezvous search game to be fully solved. Key words: rendezvous search; search games; semidefinite programming MSC2000 Subject Classification: Primary: 90B40; Secondary: 49N75, 90C22, 91A12, 93A14 OR/MS subject classification: Primary: Games/group decisions, cooperative; Secondary: Analysis of algorithms; Programming, quadratic 1. Symmetric rendezvous search on three locations In the symmetric rendezvous search game played on n locations two players are initially placed at two distinct locations.