Problem 47478. Slitherlink V: Assert/Evolve/Check (large)
This challenge is to solve Slitherlink pencil puzzles. An essential starter guide is Slitherlink Techniques. An s matrix with values from 0:5 is provided. An s of 5 means this locations edges are not provided and may be from 0:3. The player will be given the s, c, and initial p matrices. The c matrix is clarified for the creation of the solution path of nodes as given in c. The p matrix is a [numel,numel] matrix of c indices where p(x,y)=1 is a possible node connection. p(1,2)=1 as well as example's p(1,5)=1. Additional details of p are provided in the function template. Function template also includes visualization code.
This Slitherlink V: Assert/Evolve/Check(large size) is for the cases where s is not solved using only the Gimmes from Slitherlink Starting Techniques with a single Evolving and Recursion due to time and depth issues. Cases of Trivial, Gimmes, and single Evolve should be solved prior to invoking the Assert/Evolve/Check/Update method. The advanced solving techniques on the web are weak and complicated. The simple method is not to immediately invoke recursion due to the sparseness of data leading to too many false options. Ther actual simple method is to use Try/Catch by asserting segments as Black/Red and then checking if the layout using a robust Evolve creates an invalid state. If the state became invalid when asserting a single segment as Black then it must be Red with the same being true of Red assertion being invalid must mean the segment is Black. If an Evolve is invalid then Assert the right Bar type and perform an evolve to update the board. The two large test cases are from Games World of Puzzles October 2020. I was completely hopeless for the large puzzles. This set of five Cody Challenges is the result of five days banging my keyboard to solve Slitherlink.
Input: s, matrix of edge counts of the unique solution path; (c,p,bsegs,emap,pmap) are provided but not required
Output: sv, a vector of path nodes where sv(1)=sv(end). These nodes correspond to values in the c matrix example.
Slitherlink I: Trivial, Slitherlink II: Gimmes, Slitherlink III: Evolve, Slitherlink IV: Recursive(medium size)
Solution CommentsShow comments
Problem Recent Solvers2