数独求解器,而不是回溯求解器 [英] Sudoku solver, not backtracking solver

查看:32
本文介绍了数独求解器,而不是回溯求解器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去几周我一直在研究数独游戏.游戏功能丰富,例如:玩游戏、打印数独、解决数独.

解决函数使用传统的回溯,但这不是问题,问题是我需要游戏能够产生人道可解的数独,因为我需要一种能够以人类的身份解决数独的方法会做的.

如果有人能帮我弄清楚如何做到这一点,我将不胜感激.

解决方案

Andrew Stuart 的数独页面:

<块引用>

**显示可能性**1:隐藏单打2:裸对/三对3:隐藏对/三对4:裸体四边形5:指点对6:框/线减少**艰难的策略**7:X翼8:简单着色9:Y翼10:剑鱼11:XYZ翼**恶魔般的策略**12:X-周期13:XY-链14:3D美杜莎15:水母16:独特的矩形17:扩展的唯一矩形.18:隐藏的唯一矩形19:WXYZ翼20:对齐对排除**极端策略**21: 分组 X 循环22:空矩形23:带鳍的X翼24:带鳍的剑鱼25:交替.推理链26:麂皮绒27:数字强制链28:西尾强制链29:细胞强制链30:单位强制链31:几乎锁定的集合32:死亡之花33:图案叠加法34:四力链**试错"**35:鲍曼的宾果游戏

作为一个相当频繁的玩家,我将策略 11 以外的一切都判断为不再有趣".但这可能是一个品味问题.

The past few weeks I've been working on a sudoku game. The game as a lot of features such as: play game, print sudoku, solve sudoku.

The solve function uses conventional backtracking but thats not the issue, the issue is that I need the game to be able to produce a humanely solvable sudoku, for that I need a method that will be able to solve a sudoku as a human would do it.

If anyone could help me work out the mechanics of how this could be done I would greatly appreciate it.

解决方案

An overwhelming collection of Sudoku solving strategies for human players is nicely presented and explained on Andrew Stuart's Sudoku page:

**Show Possibles**         
1: Hidden Singles      
2: Naked Pairs/Triples     
3: Hidden Pairs/Triples    
4: Naked Quads     
5: Pointing Pairs      
6: Box/Line Reduction      
**Tough Strategies**  
7: X-Wing      
8: Simple Colouring        
9: Y-Wing      
10: Sword-Fish         
11: XYZ Wing       
**Diabolical Strategies** 
12: X-Cycles       
13: XY-Chain       
14: 3D Medusa      
15: Jelly-Fish         
16: Unique Rectangles      
17: Extended Unique Rect.      
18: Hidden Unique Rect's       
19: WXYZ Wing      
20: Aligned Pair Exclusion         
**Extreme Strategies**    
21: Grouped X-Cycles       
22: Empty Rectangles       
23: Finned X-Wing      
24: Finned Sword-Fish      
25: Altern. Inference Chains   
26: Sue-de-Coq         
27: Digit Forcing Chains       
28: Nishio Forcing Chains  
29: Cell Forcing Chains        
30: Unit Forcing Chains        
31: Almost Locked Sets         
32: Death Blossom      
33: Pattern Overlay Method         
34: Quad Forcing Chains        
**"Trial and Error"** 
35: Bowman's Bingo

As a fairly frequent player, I would judge everything beyond strategy 11 as "no fun anymore". But that is probably a matter of taste.

这篇关于数独求解器,而不是回溯求解器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆