title: Tiling Algorithm/Data Structures?
body: <p>I'm thinking of creating a program to let me play or solve slitherlink puzzles, like on <a href="http://krazydad.com/slitherlink/index.php?fmt=altair" rel="nofollow noreferrer">krazydad.com</a>.  It consists of tiles of 4, 5, 6, 7 and 8 sides.  All but the seven sided tiles seem to have sides with the same length, with the sides between two seven sided tiles (and therefore connecting five-sided tiles to 4 sided tiles) having sides of approximately 70% of the normal length.  As you can see in the picture below, octagons are surrounded by alternating pentagons and hexagons.  These are attached to others a by the far sides of the hexagons.  Attached to the tips of the pentagons are smaller lines connecting to squares connecting to other groups.  Around the squares are then formed seven-sided figures with two short sides.  I think the outer edge is defined by  just omitting tiles that are too far away from the center.</p>
  
  <p><img src="https://i.stack.imgur.com/Rp2Hb.png" alt="enter image description here"></p>
  
  <p>For a data structure I think I need a graph connecting all nodes.  I can let the user click to place a solid line on the closest link, and I can check for loops or too many lines entering a node fairly easily.  I'll also need to create tiles and associate lines to them, with inner lines being assigned to both tiles, but treated as one line.</p>
  
  <p>As for setting it up, I am thinking of manually figuring out the points and defining the minimal set of repeated tiles (1 8, 4 5, 4 6, 4 7 and 1 4), then placing them next to each other.  When placing, I would check for existing close points to each one I'm placing and combine them if found.  Then I would need to check for duplicate lines and merge them as well.</p>
  
  <p>Is there an easier or cleaner way to A) generate the tiling or B) merge the nodes and links when doing my tiling?</p>