1 / 36

Hashi in a Graph-Theoretic Model

Hashi in a Graph-Theoretic Model. Ben Warren. What is Hashi?. Single-player puzzle invented in Japan. “Hashi” is short for the Japanese name, “hashiwokakero”, meaning “build bridges”. The player is given a puzzle key, and seeks to construct a unique solution according to certain simple rules.

beate
Download Presentation

Hashi in a Graph-Theoretic Model

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Hashi in a Graph-Theoretic Model Ben Warren

  2. What is Hashi? • Single-player puzzle invented in Japan. “Hashi” is short for the Japanese name, “hashiwokakero”, meaning “build bridges”. • The player is given a puzzle key, and seeks to construct a unique solution according to certain simple rules.

  3. Rules of Hashi • Played on an n-by-n grid, with some spaces containing numbered islands. • The goal is to connect all of the islands with bridges such that: • All bridges run orthogonally between two distinct islands. • No two bridges cross. • Either 0, 1, or 2 bridges connect any two islands. • The number of bridges incident on an island matches that island's number. • The final puzzle solution connects all islands into a single group.

  4. Example Hashi Solution

  5. Example Hashi Solution

  6. Example Hashi Solution

  7. Example Hashi Solution

  8. Example Hashi Solution

  9. Example Hashi Solution

  10. Connection to Graph Theory • With some restrictions, it seems that hashi keys are vertex sets of an unknown solution graph with a given degree sequence. Hashi solutions seem to behave like connected planar multigraphs.

  11. Constructing a Model • In order to construct a model for hashi, we have to consider the following: • The rules of hashi depend on distances being fixed. Our model should not be “stretchable”. • The rules of hashi also demand that lines be strictly orthogonal. Our model should not be “bendable”. • We would like to force planarity for all solutions.

  12. Definitions • A unit-distance graph is a graph in which all edges are of unit length

  13. Definitions • A grid graph is a unit-distance graph which is the Cartesian product of two unit-distance path graphs.

  14. Definitions • A Hanan grid graph of a given set of vertices is the graph obtained from the intersection of all the orthogonal lines through each vertex in the set.

  15. Our Model

  16. More simply put: • We are given a hashi grid with weighted vertices. • We can construct a Hanan grid graph of all possible connections between the set of weighted vertices, such that the underlying simple graph of the hashi solution is a subgraph of the Hanan graph.

  17. Our Model in Practice: • Suppos we're given a 7x7 hashi puzzle key:

  18. Our Model in Practice: • We express the puzzle key as a 7x7 weighted unit-distance grid graph, G:

  19. Our Model in Practice: • We construct the Hanan grid graph generated by the non-zero weight vertices of G (indicated in blue):

  20. Our Model in Practice: • The hashi solution multigraph, H, has an underlying simple graph which is some subgraph of the Hanan graph of G:

  21. Our Model in Practice: • So, H can be determined as a multigraph which is a supergraph of some subset of the Hanan graph of G:

  22. Why is this model an improvement over the “common-sense” approach?

  23. Why is this model an improvement over the “common-sense” approach?

  24. Why not construct a better model? • It turns out, according to Andersson(2009), solving arbitrarily-sized hashi is an NP-complete problem. • This is bad news for anyone looking for a general solution to hashi.

  25. Some notes on P vs. NP • In computer science, there are different “complexity classes” of problems. • Problems in “P” can be solved in polynomial time. • Problems in “NP” can have their solutions verified in polynomial time. • All problems which are “NP-complete” are: • In NP • And can be reached by reducing any problem in NP.

  26. Example problems in P • Calculating greatest common divisors • Determining if a given number is prime Example problems in NPC • “Traveling salesman” problems. • Determining graph colorings • Sudoku • Hashi

  27. So, why is hashi interesting? • Besides being fun, hashi is a good “gateway” between computer science and graph theory. • It can be expressed in the language of either, but neither has offered a complete picture. • As hashi keys grow in size, their complexity compounds in a very intuitive way.

  28. 7x7

  29. 10x10

  30. 15x15

  31. 20x20

  32. 50X50

  33. 70x70

  34. Questions for future research: • We're given an arbitrarily-sized hashi key whose weighted vertices generate a Hanan graph for which all possible solution subgraphs take the form of a tree graph. Does this restricted case grant us any new conclusions?

  35. Questions for future research: • Given some small integer n, can we count all isomorphic hashi keys and solutions which can be generated for an nxn hashi? • Given a vertex-weighted nxn unit distance grid graph, G, can we determine any conditions by which G absolutely is or is not a valid hashi key?

  36. Citations • Wikipedia. “Hashiwokakero#Rules.” Accessed April 29, 2011. • Nikoli Co., Ltd. “Puzzle Cyclopedia”, ISBN 4-89072-406-0 • Andersson, Daniel, “Hashiwokakero is NP-Complete” • Eppstein. ICS 161: Design and Analysis of Algorithms Lecture notes for March 12, 1996: NP-Completeness. University of California, Irvine, n.d. Web. 1 May 2011. Special thanks to: • Simon Tatham's Portable Puzzle Collection, http://www.chiark.greenend.org.uk/~sgtatham/, distributed freely under the MIT License

More Related