National Taiwan University

Slides:



Advertisements
Similar presentations
Depth-First Search1 Part-H2 Depth-First Search DB A C E.
Advertisements

The N-Queens Problem lab01.
Experiments with MATLAB Experiments with MATLAB Google PageRank Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University, Taiwan
Breadth First Search
Preorder Traversal with a Stack Push the root onto the stack. While the stack is not empty n pop the stack and visit it.
Trees – Part 2 CS 367 – Introduction to Data Structures.
Graphs – Part II CS 367 – Introduction to Data Structures.
Sparse Vectors & Matrices Jyh-Shing Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University.
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.
CSC 172 DATA STRUCTURES.
Lecture 3 Problem Solving through search Uninformed Search
Data Structures & Algorithm Analysis lec(8):Graph T. Souad alonazi
COMP108 Algorithmic Foundations Graph Theory
Brute Force II.
Lecture 3: Uninformed Search
Trees Saurav Karmakar
Search in Google's N-grams
CSIE Dept., National Taiwan Univ., Taiwan
Quadratic Classifiers (QC)
張智星 (Roger Jang) 台大資工系 多媒體檢索實驗室
Polygon Fill Flood fill algorithm. The algorithm starts at a pixel and perform a depth first traversal of the adjacent pixels and fills the visited pixel.
Tries Jyh-Shing Roger Jang (張智星) CSIE Dept, National Taiwan University.
Feature Selection for Pattern Recognition
Cse 373 April 14th – TreEs pt 2.
Review Graph Directed Graph Undirected Graph Sub-Graph
Artificial Intelligence (CS 370D)
Breadth-First Searches
Depth First Search—Backtracking
Uninformed Search Introduction to Artificial Intelligence
Prof. Dechter ICS 270A Winter 2003
MSIS 655 Advanced Business Applications Programming
Data Structures and Algorithms for Information Processing
CS Fall 2016 (Shavlik©), Lecture 8, Week 5
Search in OOXX Games J.-S. Roger Jang (張智星) MIR Lab, CSIE Dept.
Applications of Stacks and Queues for Constraint Satisfaction Problems
Bin Sort, Radix Sort, Sparse Arrays, and Stack-based Depth-First Search CSE 373, Copyright S. Tanimoto, 2002 Bin Sort, Radix.
What to do when you don’t know anything know nothing
Objective: Today we will investigate the ‘magic’ in magic squares.
Can you get there from here?
Breadth-First Searches
Depth-First Search D B A C E Depth-First Search Depth-First Search
Depth-First Searches Introduction to AI.
CMSC 202 Trees.
Subgraphs, Connected Components, Spanning Trees
Hierarchical Clustering
Bin Sort, Radix Sort, Sparse Arrays, and Stack-based Depth-First Search CSE 373, Copyright S. Tanimoto, 2001 Bin Sort, Radix.
Queues Jyh-Shing Roger Jang (張智星)
Algorithms Lecture # 29 Dr. Sohail Aslam.
National Taiwan University
Comp3710 Artificial Intelligence Thompson Rivers University
Downhill Simplex Search (Nelder-Mead Method)
COMP108 Algorithmic Foundations Graph Theory
Applications of Heaps J.-S. Roger Jang (張智星) MIR Lab, CSIE Dept.
Query by Singing/Humming via Dynamic Programming
Insertion Sort Jyh-Shing Roger Jang (張智星)
CS Fall 2012, Lab 11 Haohan Zhu.
Prediction in Stock Trading
Naive Bayes Classifiers (NBC)
Search.
Search.
CMSC 471 Fall 2011 Class #4 Tue 9/13/11 Uninformed Search
Game Trees and Minimax Algorithm
David Kauchak CS51A – Spring 2019
Analysis and design of algorithm
Jyh-Shing Roger Jang (張智星) CSIE Dept, National Taiwan University
Storing Game Entries in an Array
Depth-First Searches.
Presentation transcript:

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

Introduction to Nonograms AKA Hanjie, Picross, Griddlers, Paint by Numbers, … Invented by Non Ishida in 1987 Examples

Properties of Nonograms (1/2) Solutions may not be unique

Properties of Nonograms (2/2) Higher density leads to easy solution Test based on 30x30 maps

Solution to Nonograms Exhaustive search Initial heuristic search 2mxn  Impossible! Initial heuristic search Reduce the search space Can also lead to a solution directly Search based on maze traversal DFS (depth-first search)  Preferred BFS (breadth-first search)  Need much more memory

Initial Heuristic Search: Examples Quiz!

Initial Heuristic Search Generate all patterns for each row Proj=[1 4 1], n=10  xxxx11xxxx Generate constrained patterns Constraint=[0xxxxxxxx1]  0xxx111xx1 My steps: Fill each rows Fill each columns Repeat 1 and 2 until convergence

Pseudo code for DFS Search Initial stack Push maps of one row to stack If size of stack > 0 { Pop stack to have a map A If A fulfils all requirements, return A and break If A has k rows, find p candidates for row k+1 Augment A with these p candidates Push these P maps to stack } No solution exists.

Some Examples