蛮力算法生成的数独董事会

编程入门 行业动态 更新时间:2024-10-24 21:20:38
本文介绍了蛮力算法生成的数独董事会的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我所开发的,最初整个数独板是空的。 一个随机的细胞(在81)的填充有随机值(1-9)。

What I am developing is that initially the entire sudoku board is empty. One of the random cells(out of 81) is filled with a random value(1-9).

现在我要填写使用暴力破解的方法的所有剩余的细胞。 从我认识了之后,谷歌上搜索的是,我们应该从第一个单元格,并用1填充它(如果它是有效的),然后填写第二个单元与2(如果它是有效的,我们将开始与一些大于检查最后填充的单元,在这种情况下是1,一旦我们达到9,我们有1重置)。

Now I want to fill all the remaining cells using brute force approach. From what I came to know after googling is that we should start with the first cell and fill it with 1(if it's valid), then fill the second cell with 2(if it's valid, we will begin checking with a number greater than the last filled cell, which in this case is 1, once we reach 9, we reset it with 1).

的事情是,它不能正常工作!

The thing is that it's not working properly!

任何人都可以联系我的精确算法。

Can anyone link me to the exact algorithm.

推荐答案

我最近做了一系列在我的博客上创建一个数独解算器在C#;你或许可以适应简单的回溯算法我present个人用途。

I recently did a series in my blog on creating a Sudoku solver in C#; you can probably adapt the simple backtracking algorithm I present to your purposes.

blogs.msdn/b/ericlippert /存档/标签/图+着色/

更多推荐

蛮力算法生成的数独董事会

本文发布于:2023-11-30 20:27:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1651383.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:董事会   算法   数独

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!