National Taiwan University

Slides:



Advertisements
Similar presentations
Dynamic Time Warping (DTW)
Advertisements

Experiments with MATLAB Experiments with MATLAB Google PageRank Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University, Taiwan
Binomial Heaps Jyh-Shing Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University.
Experiments with MATLAB Mandelbrot Set Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University
1 Trees Tree nomenclature Implementation strategies Traversals –Depth-first –Breadth-first Implementing binary search trees.
Recursion Opening Discussion zWhat did we talk about last class? zDo you have any questions about the assignment? zWhat is a recursive function?
Singly Linked Lists Jyh-Shing Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University 1.
Sorting Algorithms Jyh-Shing Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University.
Sparse Vectors & Matrices Jyh-Shing Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University.
Binary Search Jyh-Shing Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University.
March 9, 2009 Maze Solving GUI. March 9, 2009 MVC Model View Controller –Model is the application with no interfaces –View consists of graphical interfaces.
STL: Maps Jyh-Shing Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University.
Simulation of Stock Trading J.-S. Roger Jang ( 張智星 ) MIR Lab, CSIE Dept. National Taiwan University.
Linear Classifiers (LC) J.-S. Roger Jang ( 張智星 ) MIR Lab, CSIE Dept. National Taiwan University.
Artificial Intelligence Solving problems by searching.
Wei-Cheng Chen Department of Computer Science and Information Engineering National.
Search in Google's N-grams
CSIE Dept., National Taiwan Univ., Taiwan
Flood fill algorithm Also called seed fill, is an algorithm that determines the area connected to a given node in a multi-dimensional array, When applied.
Quadratic Classifiers (QC)
DP for Optimum Strategies in Games
Query by Singing/Humming via Dynamic Programming
Uninformed search Lirong Xia Spring, Uninformed search Lirong Xia Spring, 2017.
Singing Voice Separation via Active Noise Cancellation 使用主動式雜訊消除於歌聲分離
Breadth First and Depth First
Recursion A problem solving technique where an algorithm is defined in terms of itself A recursive method is a method that calls itself A recursive algorithm.
March 27 – Course introductions; Adts; Stacks and Queues
Programming Abstractions
Gradient Descent 梯度下降法
National Taiwan University
Csc 2720 Instructor: Zhuojun Duan
Constraint Satisfaction Problems vs. Finite State Problems
Review Graph Directed Graph Undirected Graph Sub-Graph
Maze Implementation, Analysis and Design to find Shortest Paths
Depth First Search—Backtracking
Programming Abstractions
Spanning Trees Longin Jan Latecki Temple University based on slides by
Search in OOXX Games J.-S. Roger Jang (張智星) MIR Lab, CSIE Dept.
Applications of Stacks and Queues for Constraint Satisfaction Problems
Problem Solving and Searching
Problem Solving and Searching
CMSC 202 Trees.
adapted from Recursive Backtracking by Mike Scott, UT Austin
Circularly Linked Lists and List Reversal
Queues Jyh-Shing Roger Jang (張智星)
CO Games Development 1 Week 8 Depth-first search, Combinatorial Explosion, Heuristics, Hill-Climbing Gareth Bellaby.
Comp3710 Artificial Intelligence Thompson Rivers University
Downhill Simplex Search (Nelder-Mead Method)
Uninformed search Lirong Xia. Uninformed search Lirong Xia.
Uninformed search Lirong Xia. Uninformed search Lirong Xia.
Applications of Heaps J.-S. Roger Jang (張智星) MIR Lab, CSIE Dept.
Query by Singing/Humming via Dynamic Programming
Insertion Sort Jyh-Shing Roger Jang (張智星)
Examples of Time Complexity
Prediction in Stock Trading
State-Space Searches.
Gradient Descent 梯度下降法
State-Space Searches.
Naive Bayes Classifiers (NBC)
Search.
Brute force “Obvious” solution Enumerate all possibilities
Search.
Game Trees and Minimax Algorithm
Analysis and design of algorithm
Duration & Pitch Modification via WSOLA
State-Space Searches.
National Taiwan University
Sorting Algorithms Jyh-Shing Roger Jang (張智星)
Jyh-Shing Roger Jang (張智星) CSIE Dept, National Taiwan University
Presentation transcript:

National Taiwan University Game of 2048 J.-S. Roger Jang (張智星) jang@mirlab.org http://mirlab.org/jang MIR Lab, CSIE Dept. National Taiwan University

Introduction to 2048 About 2048 Your mission Try out: http://2048game.com Developed by 19-year-old Italian web developer Gabriele Cirulli Release date: March 9, 2014 Goal: for an element to reach 2048 Reference on Wiki: English, Chinese Your mission Write a program to find an input sequence to reach the goal based on the concept of stacks for DFS (depth-first search).

Properties of 2048 About solution May not be solvable May have multiple solutions The behavior of the next map is implementation dependent How to combine same-value elements Probability of generating 2 and 4 TA will give you a function to generate the next state

Solution to 2048 Exhaustive search Heuristic search 4m  Impossible for a large m! Heuristic search Conservative: Maximize 2’s coverage Aggressive: Maximize Number of merges Sum of merges Many more strategies on the web Search based on maze traversal DFS (depth-first search)  Preferred BFS (breadth-first search)  Need much more memory Quiz!

Heuristic Search: Examples

Pseudo code for DFS Search Push the initial map to stack If size of stack > 0 { Pop stack to have a map A If A fulfils the requirement, return A Create p (p<=4) viable maps after each action Push these p maps to stack } No solution exists P could be zero.

More about 2048 HW TA will provide nextMap() for you to use map2=nextMap(map, action) map: current map action: 0: east, 1: south, 2: west, 3: north map2: next maps Details to be provided later To speed up, we may Start from a half-filled map Allow multiple merges in nextMap() Either a stack or recursive backtracking will do the job Limits of time and memory to be determined later