Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brute Force Solver Algorithm #2

Open
erthium opened this issue Dec 16, 2023 · 0 comments
Open

Brute Force Solver Algorithm #2

erthium opened this issue Dec 16, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@erthium
Copy link
Owner

erthium commented Dec 16, 2023

As it was said in the puzzle rules, there may be more than 1 solutions and puzzle could be still solvable. When the current solver with essential rules applied encounters such a situation, it remains as is.

We can create a second algorithm, that takes the output from current solver, and makes a random move and passes back to the current solver. If the output is not valid, brute force algorithm goes back and makes another move.

This gives room for the solver algorithms to find all possible outcomes as well.

To check if the output is invalid, two information is required:

  • if there is any island that has max_out < needed
  • if the islands create a non-continues connections

First one is quite easy to check. For the second one, we need to create a function which takes a grid and checks if everything is continues. This function would require a fully solved grid, meaning there is no island that has needed != 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant