Shirokuro : A Backtracking Approach Benjamin Bush Faculty Advisors: Dr. Russ Abbott, Dr. Gary Brookfield Department of Computer Science, Department of.

Slides:



Advertisements
Similar presentations
Heuristic Search techniques
Advertisements

Solving N+k Queens Using Dancing Links Matthew A. Wolff Morehead State University May 19, 2006.
Traveling Salesperson Problem
Iterative Deepening A* & Constraint Satisfaction Problems Lecture Module 6.
BackTracking Algorithms
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
Review Binary Search Trees Operations on Binary Search Tree
Techniques for Dealing with Hard Problems Backtrack: –Systematically enumerates all potential solutions by continually trying to extend a partial solution.
1 The Limits of Computation Intractable and Non-computable functions.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
1 Section 9.4 Spanning Trees. 2 Let G be a simple graph. A spanning subtree of G is a subgraph of G containing every vertex of G –must be connected; contains.
Search Strategies.  Tries – for word searchers, spell checking, spelling corrections  Digital Search Trees – for searching for frequent keys (in text,
Algorithm Strategies Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Graph Drawing and Information Visualization Laboratory Department of Computer Science and Engineering Bangladesh University of Engineering and Technology.
Motion Planning of Multi-Limbed Robots Subject to Equilibrium Constraints. Timothy Bretl Presented by Patrick Mihelich and Salik Syed.
Branch and Bound Similar to backtracking in generating a search tree and looking for one or more solutions Different in that the “objective” is constrained.
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
I/O-Algorithms Lars Arge University of Aarhus March 1, 2005.
I/O-Algorithms Lars Arge Spring 2009 March 3, 2009.
1 Hash-Based Indexes Chapter Introduction  Hash-based indexes are best for equality selections. Cannot support range searches.  Static and dynamic.
Randomized Planning for Short Inspection Paths Tim Danner Lydia E. Kavraki Department of Computer Science Rice University.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
Backtracking Reading Material: Chapter 13, Sections 1, 2, 4, and 5.
Branch and Bound Algorithm for Solving Integer Linear Programming
Backtracking.
Priority Models Sashka Davis University of California, San Diego June 1, 2003.
Chapter 5 Linear Inequalities and Linear Programming Section 2 Systems of Linear Inequalities in Two Variables.
SOLVING THE KAKURO PUZZLE Andreea Erciulescu Department of Mathematics, Colorado State University, Fort Collins (Mentor: A. Hulpke)
CS 2813 Discrete Structures
Copyright © Cengage Learning. All rights reserved. CHAPTER 11 ANALYSIS OF ALGORITHM EFFICIENCY ANALYSIS OF ALGORITHM EFFICIENCY.
 Jim has six children.  Chris fights with Bob,Faye, and Eve all the time; Eve fights (besides with Chris) with Al and Di all the time; and Al and Bob.
Graph Theory Topics to be covered:
Fundamentals of Algorithms MCS - 2 Lecture # 7
Approximating the Minimum Degree Spanning Tree to within One from the Optimal Degree R 陳建霖 R 宋彥朋 B 楊鈞羽 R 郭慶徵 R
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
Data Structures Using C++ 2E1 Recursion and Backtracking: DFS Depth first search (a way to traverse a tree or graph) Backtracking can be regarded as a.
Christopher Moh 2005 Competition Programming Analyzing and Solving problems.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Linear Inequalities n By n Dr. Julia Arnold n Math 04 n Intermediate Algebra.
Basic Problem Solving Search strategy  Problem can be solved by searching for a solution. An attempt is to transform initial state of a problem into some.
Problem Reduction So far we have considered search strategies for OR graph. In OR graph, several arcs indicate a variety of ways in which the original.
State space representations and search strategies - 2 Spring 2007, Juris Vīksna.
Two Connected Dominating Set Algorithms for Wireless Sensor Networks Overview Najla Al-Nabhan* ♦ Bowu Zhang** ♦ Mznah Al-Rodhaan* ♦ Abdullah Al-Dhelaan*
Chapter 13 Backtracking Introduction The 3-coloring problem
LIMITS OF FUNCTIONS. CONTINUITY Definition (p. 110) If one or more of the above conditions fails to hold at C the function is said to be discontinuous.
ICS 353: Design and Analysis of Algorithms Backtracking King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Lecture 8CSE Intro to Cognitive Science1 Interpreting Line Drawings II.
Theory of Computational Complexity Probability and Computing Chapter Hikaru Inada Iwama and Ito lab M1.
Decision Trees DEFINITION: DECISION TREE A decision tree is a tree in which the internal nodes represent actions, the arcs represent outcomes of an action,
Discrete ABC Based on Similarity for GCP
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Courtsey & Copyright: DESIGN AND ANALYSIS OF ALGORITHMS Courtsey & Copyright:
Constraint Satisfaction Problems vs. Finite State Problems
Constraint Satisfaction Problem
CS120 Graphs.
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Finding Heuristics Using Abstraction
Back Tracking.
Depth Estimation via Sampling
Searching for Solutions
Analysis & Design of Algorithms (CSCE 321)
Artificial Intelligence
A General Backtracking Algorithm
Minimax strategies, alpha beta pruning
Adaptivity and Dynamic Load Balancing
Graphs.
ICS 353: Design and Analysis of Algorithms
Minimax strategies, alpha beta pruning
Presentation transcript:

Shirokuro : A Backtracking Approach Benjamin Bush Faculty Advisors: Dr. Russ Abbott, Dr. Gary Brookfield Department of Computer Science, Department of Mathematics College of Engineering, Computer Science, and Technology, College of Natural and Social Sciences California State University, Los Angeles Funding provided by National Science Foundation grant #HRD and the CSU Chancellor's Office Introduction We strive to develop an algorithm that can find the solutions to a given Shirokuro puzzle in a reasonable amount of time. We employ a simple yet powerful technique known as “backtracking,” which incrementally builds candidate solutions and abandons each partial candidate (backtracks) as soon as it determines that the candidate cannot possibly be extended to create a valid solution. Dead End Detection Below are two nontrivial Shirokuro configurations that our backtracking algorithm currently detects as dead ends. This above configuration, known as the diamond, leads to the separation of at least 1 pair of disks. To see this, note that any connection that is made between the two black disks invariably forms a loop which completely encapsulates one of the white disks, making any connection between the two white disks impossible. How To Play Shirokuro Fill in every empty grid space so that the following conditions are satisfied: No two-by-two region of the grid contains four disks of the same color. Each pair of like-colored disks is connected via a chain which travels horizontally or vertically through disks of the same color as the pair. example solution Backtracking essentially amounts to a depth first search through the tree of all partial candidate solutions to a problem. Each time a partial candidate solution is determined to be a dead end, a portion of the tree is pruned, resulting in a smaller search space. Good backtracking algorithms can efficiently detect dead ends at nodes that are close to the root, so that the pruned subtrees are as large as possible. If two black disks lie along the boundary of the grid, they must be connected by a chain of black disks, all of which also lie along the boundary. To see why, consider the alternative: suppose a pair of black disks and a pair of white disks are arranged along the boundary so that such a chain would be impossible, as illustrated above (left). Then any connection drawn between the two black disks would bisect the grid, isolating the pair of white discs from one another (right). Detecting Isolated Groups Since no colored disk may become isolated from others of it’s kind, the early and efficient detection of isolated groups of disks is essential for achieving a reasonable runtime. To this end, we have developed a technique which involves building and maintaining a pair of spanning trees. S represents the current state of the Shirokuro solving process. S white and S black are a modified version of S formed by filling every empty cell with white or black disks, respectively. The tree shown in S white spans the region that the white disks in S may potentially connect with. SS white S black Theorem: A graph G is connected if and only if it has a spanning tree. Thus, if our algorithm finds that there does not exist a tree spanning the white disks in S white, we may conclude that there are regions of the grid that are isolated from each other, as far as the white disks are concerned. A similar situation holds for S black. One of the advantages of using spanning trees is the ease with which they can be restructured when disturbed. In figure above, the spanning tree connecting the black disks is broken into 3 pieces when one of it’s nodes is removed. The smaller pieces are searched and found to contain nodes that can be reconnected (starred). These nodes become the new roots of their respective subtrees in the final configuration. Dynamic Variable Ordering In most backtracking algorithms, the order in which variables are instantiated is not fixed, but instead changes dynamically by following several variable ordering heuristics. One important heuristic, the degree heuristic, states that those variables that are involved in a larger number of constraints should be instantiated first. In our future work, we will be exploring the role that our spanning trees may have in dynamic variable ordering. In the figure to the left, the cell in the center should be instantiated first because it is involved in 4 “two-by- two” constraints, 1 “boundary” constraint, and 1 global constraint for a total of 5 constraints