From 69415805c5c142db775c32ca4294bd506a812f82 Mon Sep 17 00:00:00 2001 From: Zachary VANVLASSELAER Date: Sun, 19 Nov 2023 01:40:16 +0100 Subject: [PATCH] TODO NEXT : - complex BUG-Lite and whips/nrczt-chains --- .../Possibility/IReadOnlyPossibilities.cs | 10 +- Model/Solver/Possibility/Possibilities.cs | 2 +- .../AlternatingChainAlgorithmV4.cs | 2 +- Model/Solver/Strategies/BUGLiteStrategy.cs | 122 ++++------ .../Strategies/ComplexBUGLiteStrategy.cs | 93 ++++++++ Model/Solver/Strategies/ReverseBUGStrategy.cs | 3 - .../SetEquivalence/Searchers/SearcherUtils.cs | 210 ------------------ Model/Solver/Strategies/WXYZWingStrategy.cs | 4 +- Model/Solver/StrategiesUtility/SharedUnits.cs | 8 +- RunTester/RunResults/OnlineBank3RunResult.txt | 90 ++++---- Tests/UnitTest1.cs | 7 +- 11 files changed, 195 insertions(+), 356 deletions(-) create mode 100644 Model/Solver/Strategies/ComplexBUGLiteStrategy.cs delete mode 100644 Model/Solver/Strategies/SetEquivalence/Searchers/SearcherUtils.cs diff --git a/Model/Solver/Possibility/IReadOnlyPossibilities.cs b/Model/Solver/Possibility/IReadOnlyPossibilities.cs index 58249997..5178c336 100644 --- a/Model/Solver/Possibility/IReadOnlyPossibilities.cs +++ b/Model/Solver/Possibility/IReadOnlyPossibilities.cs @@ -46,13 +46,11 @@ public static Possibilities DefaultAnd(IReadOnlyPossibilities poss1, IReadOnlyPo return result; } - public static Possibilities DefaultInvert(IReadOnlyPossibilities possibilities) + public static Possibilities DefaultDifference(IReadOnlyPossibilities poss1, IReadOnlyPossibilities poss2) { - var result = new Possibilities(); - for (int i = Min; i <= Max; i++) - { - if (!possibilities.Peek(i)) result.Add(i); - } + var result = poss1.Copy(); + + foreach (var poss in poss2) result.Remove(poss); return result; } diff --git a/Model/Solver/Possibility/Possibilities.cs b/Model/Solver/Possibility/Possibilities.cs index ec184b9c..ada4ec46 100644 --- a/Model/Solver/Possibility/Possibilities.cs +++ b/Model/Solver/Possibility/Possibilities.cs @@ -91,7 +91,7 @@ public Possibilities Difference(IReadOnlyPossibilities possibilities) return new Possibilities(diff, System.Numerics.BitOperations.PopCount((uint) diff)); } - return new Possibilities(); //TODO + return IReadOnlyPossibilities.DefaultDifference(this, possibilities); } public Possibilities Invert() diff --git a/Model/Solver/Strategies/AlternatingChains/ChainAlgorithms/AlternatingChainAlgorithmV4.cs b/Model/Solver/Strategies/AlternatingChains/ChainAlgorithms/AlternatingChainAlgorithmV4.cs index 64fe5c43..a63be19b 100644 --- a/Model/Solver/Strategies/AlternatingChains/ChainAlgorithms/AlternatingChainAlgorithmV4.cs +++ b/Model/Solver/Strategies/AlternatingChains/ChainAlgorithms/AlternatingChainAlgorithmV4.cs @@ -5,7 +5,7 @@ namespace Model.Solver.Strategies.AlternatingChains.ChainAlgorithms; -public class AlternatingChainAlgorithmV4 : IAlternatingChainAlgorithm where T : ILinkGraphElement //TODO fix -> Take into account mono-directionnal links +public class AlternatingChainAlgorithmV4 : IAlternatingChainAlgorithm where T : ILinkGraphElement { public void Run(IStrategyManager view, LinkGraph graph, IAlternatingChainType chainType) { diff --git a/Model/Solver/Strategies/BUGLiteStrategy.cs b/Model/Solver/Strategies/BUGLiteStrategy.cs index cf9dd847..1ef77f3e 100644 --- a/Model/Solver/Strategies/BUGLiteStrategy.cs +++ b/Model/Solver/Strategies/BUGLiteStrategy.cs @@ -1,14 +1,13 @@ using System.Collections.Generic; -using System.Linq; +using Global; using Global.Enums; using Model.Solver.Helpers.Changes; using Model.Solver.Position; -using Model.Solver.Possibility; using Model.Solver.StrategiesUtility; namespace Model.Solver.Strategies; -public class BUGLiteStrategy : AbstractStrategy +public class BUGLiteStrategy : AbstractStrategy //TODO check if working => #574 { public const string OfficialName = "BUG-Lite"; private const OnCommitBehavior DefaultBehavior = OnCommitBehavior.Return; @@ -22,7 +21,7 @@ public BUGLiteStrategy() : base(OfficialName, StrategyDifficulty.Hard, DefaultBe public override void Apply(IStrategyManager strategyManager) { - Dictionary biValueMap = new(); + Dictionary> biValueMap = new(); for (int row = 0; row < 9; row++) { for (int col = 0; col < 9; col++) @@ -39,109 +38,70 @@ public override void Apply(IStrategyManager strategyManager) if (!biValueMap.TryGetValue(bi, out var list)) { - list = new GridPositions(); + list = new List(); biValueMap[bi] = list; } - list.Add(row, col); + list.Add(new Cell(row, col)); } } foreach (var entry in biValueMap) { if (entry.Value.Count < 3) continue; - - var soloRow = UniquenessHelper.SearchExceptionInUnit(Unit.Row, 2, entry.Value); - if (soloRow == -1) continue; - - var soloCol = UniquenessHelper.SearchExceptionInUnit(Unit.Column, 2, entry.Value); - if (soloCol == -1) continue; - var soloMini = UniquenessHelper.SearchExceptionInUnit(Unit.MiniGrid, 2, entry.Value); - if (soloMini == -1) continue; + if (Search(strategyManager, entry.Value, 0, new GridPositions(), entry.Key)) return; + } + } - var miniRow = soloMini / 3; - var miniCol = soloCol / 3; + private bool Search(IStrategyManager strategyManager, List cells, int start, GridPositions positions, BiValue bi) + { + for (int i = start; i < cells.Count; i++) + { + positions.Add(cells[i]); - if (soloRow / 3 == miniRow && soloCol / 3 == miniCol) - { - strategyManager.ChangeBuffer.ProposePossibilityRemoval(entry.Key.One, soloRow, soloCol); - strategyManager.ChangeBuffer.ProposePossibilityRemoval(entry.Key.Two, soloRow, soloCol); - } + if (positions.Count >= 3 && positions.Count % 2 == 1 && Try(strategyManager, positions, bi)) return true; - if (strategyManager.ChangeBuffer.NotEmpty() && strategyManager.ChangeBuffer.Commit(this, - new BUGLiteReportBuilder(entry.Value, soloRow, soloCol))) - { - if(OnCommitBehavior == OnCommitBehavior.Return) return; - } + Search(strategyManager, cells, i + 1, positions, bi); + + positions.Remove(cells[i]); } - var asArray = biValueMap.Keys.ToArray(); + return false; + } + + private bool Try(IStrategyManager strategyManager, GridPositions positions, BiValue bi) + { + var soloRow = UniquenessHelper.SearchExceptionInUnit(Unit.Row, 2, positions); + if (soloRow == -1) return false; + + var soloCol = UniquenessHelper.SearchExceptionInUnit(Unit.Column, 2, positions); + if (soloCol == -1) return false; + + var soloMini = UniquenessHelper.SearchExceptionInUnit(Unit.MiniGrid, 2, positions); + if (soloMini == -1) return false; - for (int i = 0; i < asArray.Length - 2; i++) + var miniRow = soloMini / 3; + var miniCol = soloCol / 3; + + if (soloRow / 3 == miniRow && soloCol / 3 == miniCol) { - for (int j = i + 1; j < asArray.Length - 1; j++) - { - for (int k = j + 1; j < asArray.Length; j++) - { - var one = asArray[i]; - var two = asArray[j]; - var three = asArray[k]; - - var possibilities = Possibilities.NewEmpty(); - possibilities.Add(one.One); - possibilities.Add(one.Two); - possibilities.Add(two.One); - possibilities.Add(two.Two); - possibilities.Add(three.One); - possibilities.Add(three.Two); - - if(possibilities.Count != 3) continue; - - var or = biValueMap[one].Or(biValueMap[two].Or(biValueMap[three])); - if (or.Count < 5) continue; - - var soloRow = UniquenessHelper.SearchExceptionInUnit(Unit.Row, - UniquenessHelper.ComputeExpectedCount(Unit.Row, biValueMap[one], biValueMap[two], biValueMap[three]), or); - if (soloRow == -1) continue; - - var soloCol = UniquenessHelper.SearchExceptionInUnit(Unit.Column, - UniquenessHelper.ComputeExpectedCount(Unit.Column, biValueMap[one], biValueMap[two], biValueMap[three]), or); - if (soloCol == -1) continue; - - var soloMini = UniquenessHelper.SearchExceptionInUnit(Unit.MiniGrid, - UniquenessHelper.ComputeExpectedCount(Unit.MiniGrid, biValueMap[one], biValueMap[two], biValueMap[three]), or); - if (soloMini == -1) continue; - - var miniRow = soloMini / 3; - var miniCol = soloCol / 3; - - if (soloRow / 3 == miniRow && soloCol / 3 == miniCol) - { - foreach (var p in possibilities) - { - strategyManager.ChangeBuffer.ProposePossibilityRemoval(p, soloRow, soloCol); - } - } - - if (strategyManager.ChangeBuffer.NotEmpty() && strategyManager.ChangeBuffer.Commit(this, - new BUGLiteReportBuilder(or, soloRow, soloCol))) - { - if(OnCommitBehavior == OnCommitBehavior.Return) return; - } - } - } + strategyManager.ChangeBuffer.ProposePossibilityRemoval(bi.One, soloRow, soloCol); + strategyManager.ChangeBuffer.ProposePossibilityRemoval(bi.Two, soloRow, soloCol); } + + return strategyManager.ChangeBuffer.NotEmpty() && strategyManager.ChangeBuffer.Commit(this, + new BUGLiteReportBuilder(positions, soloRow, soloCol)) && OnCommitBehavior == OnCommitBehavior.Return; } } public class BUGLiteReportBuilder : IChangeReportBuilder { - private readonly GridPositions _gp; + private readonly IEnumerable _gp; private readonly int _row; private readonly int _col; - public BUGLiteReportBuilder(GridPositions gp, int row, int col) + public BUGLiteReportBuilder(IEnumerable gp, int row, int col) { _gp = gp; _row = row; diff --git a/Model/Solver/Strategies/ComplexBUGLiteStrategy.cs b/Model/Solver/Strategies/ComplexBUGLiteStrategy.cs new file mode 100644 index 00000000..3c81ac18 --- /dev/null +++ b/Model/Solver/Strategies/ComplexBUGLiteStrategy.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using Global; +using Model.Solver.StrategiesUtility; + +namespace Model.Solver.Strategies; + +public class ComplexBUGLiteStrategy : AbstractStrategy +{ + public const string OfficialName = "BUG-Lite"; + private const OnCommitBehavior DefaultBehavior = OnCommitBehavior.Return; + + public override OnCommitBehavior DefaultOnCommitBehavior => DefaultBehavior; + + public ComplexBUGLiteStrategy() : base(OfficialName, StrategyDifficulty.Extreme, DefaultBehavior) { } + + public override void Apply(IStrategyManager strategyManager) + { + var biValueMap = GetBiValueMap(strategyManager); + + foreach (var entry in biValueMap) + { + var list = entry.Value; + if (list.Count < 2) continue; + + for (int i = 0; i < list.Count - 1; i++) + { + for (int j = i + 1; j < list.Count; j++) + { + var one = list[i]; + var two = list[j]; + + var sharedUnits = new SharedUnits(one); + sharedUnits.Share(two); + if (sharedUnits.Count != 2) continue; + + if (Search(strategyManager, new BiValueBlock(entry.Key, sharedUnits, one, two))) return; + } + } + } + } + + private bool Search(IStrategyManager strategyManager, BiValueBlock start) + { + return false; + } + + private Dictionary> GetBiValueMap(IStrategyManager strategyManager) + { + Dictionary> biValueMap = new(); + for (int row = 0; row < 9; row++) + { + for (int col = 0; col < 9; col++) + { + var poss = strategyManager.PossibilitiesAt(row, col); + if (poss.Count != 2) continue; + + var i = 0; + poss.Next(ref i); + var first = i; + poss.Next(ref i); + var second = i; + var bi = new BiValue(first, second); + + if (!biValueMap.TryGetValue(bi, out var list)) + { + list = new List(); + biValueMap[bi] = list; + } + + list.Add(new Cell(row, col)); + } + } + + return biValueMap; + } +} + +public class BiValueBlock +{ + public BiValueBlock(BiValue biValue, SharedUnits sharedUnits, params Cell[] cells) + { + if (cells.Length != 2) throw new ArgumentException("Has to be 2 cells"); + + BiValue = biValue; + SharedUnits = sharedUnits; + Cells = cells; + } + + public BiValue BiValue { get; } + public SharedUnits SharedUnits { get; } + public Cell[] Cells { get; } +} \ No newline at end of file diff --git a/Model/Solver/Strategies/ReverseBUGStrategy.cs b/Model/Solver/Strategies/ReverseBUGStrategy.cs index d732cac3..a88c594f 100644 --- a/Model/Solver/Strategies/ReverseBUGStrategy.cs +++ b/Model/Solver/Strategies/ReverseBUGStrategy.cs @@ -6,9 +6,6 @@ namespace Model.Solver.Strategies; -/// -/// http://forum.enjoysudoku.com/the-reverse-bug-t4431.html -/// public class ReverseBUGStrategy : AbstractStrategy { public const string OfficialName = "Reverse BUG"; diff --git a/Model/Solver/Strategies/SetEquivalence/Searchers/SearcherUtils.cs b/Model/Solver/Strategies/SetEquivalence/Searchers/SearcherUtils.cs deleted file mode 100644 index 8dc162e1..00000000 --- a/Model/Solver/Strategies/SetEquivalence/Searchers/SearcherUtils.cs +++ /dev/null @@ -1,210 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Documents; -using Global; - -namespace Model.Solver.Strategies.SetEquivalence.Searchers; - -public static class SearcherUtils -{ - public static readonly HouseFiller[] Fillers = - { - new RowFiller(0), - new RowFiller(1), - new RowFiller(2), - new RowFiller(3), - new RowFiller(4), - new RowFiller(5), - new RowFiller(6), - new RowFiller(7), - new RowFiller(8), - new ColumnFiller(0), - new ColumnFiller(1), - new ColumnFiller(2), - new ColumnFiller(3), - new ColumnFiller(4), - new ColumnFiller(5), - new ColumnFiller(6), - new ColumnFiller(7), - new ColumnFiller(8), - new MiniGridFiller(0, 0), - new MiniGridFiller(0, 1), - new MiniGridFiller(0, 2), - new MiniGridFiller(1, 0), - new MiniGridFiller(1, 1), - new MiniGridFiller(1, 2), - new MiniGridFiller(2, 0), - new MiniGridFiller(2, 1), - new MiniGridFiller(2, 2) - }; - - public static void TestHouses(int minHouseCount, int maxHouseCount) - { - HashSet one = new(); - HashSet two = new(); - - //TODO - } - - private static void Print(IEnumerable one, IEnumerable two) - { - var builder = new StringBuilder(); - - foreach (var i in one) - { - builder.Append(Fillers[i] + " "); - } - - builder.Append("--- "); - - foreach (var j in two) - { - builder.Append(Fillers[j] + " "); - } - - Printer.Print(builder.ToString()); - } -} - -public static class Printer -{ - private static int _count = 1; - - public static void Print(string s) - { - Console.WriteLine($"#{_count} : {s}"); - _count++; - } -} - -public struct IntSet -{ - private int _set; - - public void Add(int n) - { - _set |= 1 << n; - } - - -} - -public abstract class HouseFiller -{ - public int Number { get; set; } - - public abstract int HouseNumber { get; } - - public void Fill(int[,] grid) - { - foreach (var cell in AllCells()) - { - grid[cell.Row, cell.Col] += Number; - } - } - - public void UnFill(int[,] grid) - { - foreach (var cell in AllCells()) - { - grid[cell.Row, cell.Col] -= Number; - } - } - - public bool CanFill(int[,] grid) - { - bool result = false; - - foreach (var cell in AllCells()) - { - var current = grid[cell.Row, cell.Col]; - if (current == Number) return false; - if (current == -Number) result = true; - } - - return result; - } - - protected abstract IEnumerable AllCells(); -} - -public class RowFiller : HouseFiller -{ - private readonly int _row; - - public RowFiller(int row) - { - _row = row; - } - - public override int HouseNumber => _row; - - protected override IEnumerable AllCells() - { - for (int col = 0; col < 9; col++) - { - yield return new Cell(_row, col); - } - } - - public override string ToString() - { - return "r" + HouseNumber; - } -} - -public class ColumnFiller : HouseFiller -{ - private readonly int _col; - - public ColumnFiller(int col) - { - _col = col; - } - - public override int HouseNumber => _col; - - protected override IEnumerable AllCells() - { - for (int row = 0; row < 9; row++) - { - yield return new Cell(row, _col); - } - } - - public override string ToString() - { - return "c" + HouseNumber; - } -} - -public class MiniGridFiller : HouseFiller -{ - private readonly int _miniRow; - private readonly int _miniCol; - - public MiniGridFiller(int miniRow, int miniCol) - { - _miniRow = miniRow; - _miniCol = miniCol; - } - - public override int HouseNumber => _miniRow * 3 + _miniCol; - - protected override IEnumerable AllCells() - { - for (int r = 0; r < 3; r++) - { - for (int c = 0; c < 3; c++) - { - yield return new Cell(_miniRow * 3 + r, _miniCol * 3 + c); - } - } - } - - public override string ToString() - { - return "m" + HouseNumber; - } -} diff --git a/Model/Solver/Strategies/WXYZWingStrategy.cs b/Model/Solver/Strategies/WXYZWingStrategy.cs index 41ac7600..864f3e98 100644 --- a/Model/Solver/Strategies/WXYZWingStrategy.cs +++ b/Model/Solver/Strategies/WXYZWingStrategy.cs @@ -189,7 +189,7 @@ private bool Process(IStrategyManager strategyManager, MiniGridPositions miniPos if (sharedUnits is null) sharedUnits = new SharedUnits(current); else { - sharedUnits.IsShared(current); + sharedUnits.Share(current); if (sharedUnits.Count != 0) continue; if (buffer != -1) return false; @@ -216,7 +216,7 @@ private bool Process(IStrategyManager strategyManager, MiniGridPositions miniPos if (sharedUnits is null) sharedUnits = new SharedUnits(current); else { - sharedUnits.IsShared(current); + sharedUnits.Share(current); if (sharedUnits.Count != 0) continue; if (buffer != -1) return false; diff --git a/Model/Solver/StrategiesUtility/SharedUnits.cs b/Model/Solver/StrategiesUtility/SharedUnits.cs index be71ab6d..ac4d7c69 100644 --- a/Model/Solver/StrategiesUtility/SharedUnits.cs +++ b/Model/Solver/StrategiesUtility/SharedUnits.cs @@ -6,7 +6,7 @@ namespace Model.Solver.StrategiesUtility; public class SharedUnits : IEnumerable { - //3 times 4 bits representing the unit number and then 1 bit for if it is shared (1) or not (2) + //3 times 4 bits representing the unit number and then 1 bit for if it is shared (1) or not (0) //1mmmm1cccc1rrrr private int _units; public int Count { get; private set; } @@ -22,7 +22,7 @@ public SharedUnits(Cell cell) : this(cell.Row, cell.Col) } - private void IsShared(int row, int col) + private void Share(int row, int col) { if (Peek(4)) { @@ -52,9 +52,9 @@ private void IsShared(int row, int col) } } - public void IsShared(Cell cell) + public void Share(Cell cell) { - IsShared(cell.Row, cell.Col); + Share(cell.Row, cell.Col); } private int ToGridNumber(int row, int col) diff --git a/RunTester/RunResults/OnlineBank3RunResult.txt b/RunTester/RunResults/OnlineBank3RunResult.txt index 98518da9..bf88d33d 100644 --- a/RunTester/RunResults/OnlineBank3RunResult.txt +++ b/RunTester/RunResults/OnlineBank3RunResult.txt @@ -5,93 +5,97 @@ Solver fails : 0 Strategy name | Usage | Score | Solutions added | Possibilities removed | Score percentage | Total time | Average time -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Naked Single | 46150 | 21582 | 62431 | 0 | 46.76% | 0.079s | 0.0017ms + Naked Single | 51657 | 23467 | 65344 | 0 | 45.43% | 0.13s | 0.0025ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Hidden Single | 24568 | 8973 | 16432 | 0 | 36.52% | 0.225s | 0.0092ms + Hidden Single | 28190 | 9633 | 17425 | 0 | 34.17% | 0.398s | 0.0141ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Naked Doubles | 15595 | 2460 | 0 | 11772 | 15.77% | 0.152s | 0.0097ms + Naked Doubles | 18557 | 2642 | 0 | 12195 | 14.24% | 0.257s | 0.0138ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Hidden Doubles | 13135 | 1813 | 0 | 11615 | 13.8% | 0.169s | 0.0129ms + Hidden Doubles | 15915 | 1925 | 0 | 11846 | 12.1% | 0.304s | 0.0191ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Box-Line Reduction | 11322 | 2668 | 0 | 10520 | 23.56% | 0.125s | 0.011ms + Box-Line Reduction | 13990 | 2935 | 0 | 10928 | 20.98% | 0.268s | 0.0192ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Pointing Set | 8654 | 754 | 0 | 2807 | 8.71% | 0.066s | 0.0076ms + Pointing Set | 11055 | 867 | 0 | 2959 | 7.84% | 0.145s | 0.0131ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Naked Triple | 7900 | 281 | 0 | 1285 | 3.56% | 0.273s | 0.0346ms + Naked Triple | 10188 | 316 | 0 | 1372 | 3.1% | 0.526s | 0.0516ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Hidden Triple | 7619 | 157 | 0 | 912 | 2.06% | 0.348s | 0.0457ms + Hidden Triple | 9872 | 174 | 0 | 953 | 1.76% | 0.651s | 0.0659ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Naked Quad | 7462 | 19 | 0 | 111 | 0.25% | 0.436s | 0.0584ms + Naked Quad | 9698 | 18 | 0 | 109 | 0.19% | 0.828s | 0.0854ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Hidden Quad | 7443 | 3 | 0 | 13 | 0.04% | 0.499s | 0.067ms + Hidden Quad | 9680 | 3 | 0 | 13 | 0.03% | 0.968s | 0.1ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Gurth's Theorem | 7440 | 0 | 0 | 0 | 0% | 0.054s | 0.0073ms + Gurth's Theorem | 9677 | 0 | 0 | 0 | 0% | 0.104s | 0.0107ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - X-Wing | 7440 | 159 | 0 | 473 | 2.14% | 0.092s | 0.0124ms + X-Wing | 9677 | 195 | 0 | 559 | 2.02% | 0.16s | 0.0165ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - XY-Wing | 7281 | 290 | 0 | 588 | 3.98% | 0.143s | 0.0196ms + XY-Wing | 9482 | 388 | 0 | 762 | 4.09% | 0.229s | 0.0242ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - XYZ-Wing | 6991 | 213 | 0 | 242 | 3.05% | 0.079s | 0.0113ms + XYZ-Wing | 9094 | 255 | 0 | 293 | 2.8% | 0.151s | 0.0166ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Swordfish | 6778 | 53 | 0 | 230 | 0.78% | 0.184s | 0.0271ms + Swordfish | 8839 | 61 | 0 | 255 | 0.69% | 0.365s | 0.0413ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Jellyfish | 6725 | 2 | 0 | 8 | 0.03% | 0.296s | 0.044ms + Jellyfish | 8778 | 2 | 0 | 8 | 0.02% | 0.579s | 0.066ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Simple Coloring | 6723 | 452 | 289 | 534 | 6.72% | 0.827s | 0.123ms + Simple Coloring | 8776 | 549 | 274 | 655 | 6.26% | 1.543s | 0.1758ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - BUG | 6271 | 8 | 8 | 0 | 0.13% | 0.005s | 0.0008ms + BUG | 8227 | 9 | 9 | 0 | 0.11% | 0.011s | 0.0013ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Reverse BUG | 6263 | 10 | 0 | 10 | 0.16% | 0.053s | 0.0085ms + Reverse BUG | 8218 | 27 | 0 | 27 | 0.33% | 0.112s | 0.0136ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Junior Exocet | 6253 | 0 | 0 | 0 | 0% | 0.198s | 0.0317ms + Junior Exocet | 8191 | 2 | 0 | 4 | 0.02% | 0.57s | 0.0696ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Finned X-Wing | 6253 | 734 | 0 | 1266 | 11.74% | 0.408s | 0.0652ms + Finned X-Wing | 8189 | 862 | 0 | 1476 | 10.53% | 0.748s | 0.0913ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Finned Swordfish | 5519 | 244 | 0 | 394 | 4.42% | 0.311s | 0.0564ms + Finned Swordfish | 7327 | 291 | 0 | 457 | 3.97% | 0.614s | 0.0838ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Finned Jellyfish | 5275 | 19 | 0 | 22 | 0.36% | 0.338s | 0.0641ms + Finned Jellyfish | 7036 | 20 | 0 | 24 | 0.28% | 0.606s | 0.0861ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Fireworks | 5256 | 46 | 0 | 85 | 0.88% | 1.41s | 0.2683ms + Fireworks | 7016 | 59 | 0 | 95 | 0.84% | 2.341s | 0.3337ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - SK-Loops | 5210 | 2 | 0 | 31 | 0.04% | 0.125s | 0.024ms + SK-Loops | 6957 | 2 | 0 | 31 | 0.03% | 0.221s | 0.0318ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Unique Rectangles | 5208 | 833 | 0 | 1895 | 15.99% | 0.155s | 0.0298ms + Unique Rectangles | 6955 | 964 | 0 | 2040 | 13.86% | 0.308s | 0.0443ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Avoidable Rectangles | 4375 | 17 | 0 | 25 | 0.39% | 0.076s | 0.0174ms + Unavoidable Rectangles | 5991 | 20 | 0 | 30 | 0.33% | 0.168s | 0.028ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - XY-Chain | 4358 | 512 | 0 | 3161 | 11.75% | 0.571s | 0.131ms + BUG-Lite | 5971 | 35 | 0 | 44 | 0.59% | 0.043s | 0.0072ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - 3D Medusa | 3846 | 254 | 335 | 390 | 6.6% | 0.901s | 0.2343ms + XY-Chain | 5936 | 657 | 0 | 3960 | 11.07% | 1.116s | 0.188ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - WXYZ-Wing | 3592 | 102 | 0 | 144 | 2.84% | 1.143s | 0.3182ms + 3D Medusa | 5279 | 374 | 574 | 575 | 7.08% | 1.772s | 0.3357ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Aligned Pair Exclusion | 3490 | 524 | 0 | 747 | 15.01% | 10.239s | 2.9338ms + WXYZ-Wing | 4905 | 119 | 0 | 169 | 2.43% | 2.184s | 0.4453ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - X-Cycles | 2966 | 266 | 10 | 484 | 8.97% | 9.762s | 3.2913ms + Sue-De-Coq | 4786 | 97 | 0 | 439 | 2.03% | 2.95s | 0.6164ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Sue-De-Coq | 2700 | 71 | 0 | 300 | 2.63% | 1.119s | 0.4144ms + Aligned Pair Exclusion | 4689 | 526 | 0 | 834 | 11.22% | 9.336s | 1.991ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Almost Locked Sets | 2629 | 1007 | 0 | 2722 | 38.3% | 31.21s | 11.8714ms + Aligned Triple Exclusion | 4163 | 327 | 0 | 485 | 7.85% | 33.706s | 8.0966ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Death Blossom | 1622 | 412 | 0 | 794 | 25.4% | 17.83s | 10.9926ms + X-Cycles | 3836 | 288 | 9 | 513 | 7.51% | 18.529s | 4.8303ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Alternating Inference Chain | 0 | 0 | 0 | 0 | 0% | 0s | 0ms + Almost Hidden Sets | 3548 | 127 | 40 | 383 | 3.58% | 5.652s | 1.593ms +-----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- + Almost Locked Sets | 3421 | 905 | 0 | 1874 | 26.45% | 37.563s | 10.9801ms +-----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- + Death Blossom | 2516 | 516 | 0 | 919 | 20.51% | 26.229s | 10.4249ms +-----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- + Alternating Inference Chain | 2000 | 1208 | 913 | 7658 | 60.4% | 45.61s | 22.805ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- Set Equivalence | 0 | 0 | 0 | 0 | 0% | 0s | 0ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Digit Forcing Net | 1210 | 1098 | 6746 | 27688 | 90.74% | 51.932s | 42.919ms + Digit Forcing Net | 792 | 680 | 1666 | 11841 | 85.86% | 36.247s | 45.7664ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Cell Forcing Net | 112 | 85 | 36 | 628 | 75.89% | 0.038s | 0.3393ms + Cell Forcing Net | 112 | 85 | 33 | 608 | 75.89% | 0.052s | 0.4643ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Unit Forcing Net | 27 | 18 | 2 | 53 | 66.67% | 0.023s | 0.8519ms + Unit Forcing Net | 27 | 18 | 2 | 53 | 66.67% | 0.025s | 0.9259ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- - Nishio Forcing Net | 9 | 9 | 0 | 170 | 100% | 0.026s | 2.8889ms + Nishio Forcing Net | 9 | 9 | 0 | 171 | 100% | 0.034s | 3.7778ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- Pattern Overlay | 0 | 0 | 0 | 0 | 0% | 0s | 0ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- Brute Force | 0 | 0 | 0 | 0 | 0% | 0s | 0ms -----------------------------+-------+-------+-----------------+-----------------------+------------------+------------+-------------- -Total strategy time : 131,92s - -Time taken : 132,733s +Total strategy time : 234,353s diff --git a/Tests/UnitTest1.cs b/Tests/UnitTest1.cs index c0540ca1..05718681 100644 --- a/Tests/UnitTest1.cs +++ b/Tests/UnitTest1.cs @@ -1,12 +1,9 @@ + + namespace Tests; public class Tests { - [SetUp] - public void Setup() - { - } - [Test] public void Test1() {