This R package implements backtracking algorithms to solve some of these problems.
Install from GitHub:
devtools::install_github('jsphdms/backtrack')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.