Help with C++ Sudoku Solver

Each Cell should be represented as an object, with fields to hold: an integer as the contained value (once known), a flag to show whether the value was pre-defined in the data-file or has been derived during solving, and a candidate list to show at any point during the solution process what the possible value of the cell could be, while it is still to be decided. The design of the candidate list is your decision and it could be represented in a number of ways, e.g. as an array or as a std::vector. The Sudoku puzzle grid is then a 9x9 2D array of cell objects. Develop code which can populate the grid by input of a starting pattern of predefined values which will be provided as a data-file of 9 lines, each containing 9 integers in the range 0-9, with 0 signifying an unknown value (as described in the Overview). Develop further code to visit each cell in turn and, for each unknown value, build its candidate list by eliminating from the valid set of digits (1-9), all the values that already appear as predefined values in the ‘triple context’ of the cell – its row, column and block. The next step is to consider the candidate list of each cell where the final value is missing in turn and, if possible, identify a value for each cell as a naked single (if the candidate list has only one member value) or as a hidden single (if one member of the candidate list can be shown to not occur in candidate lists elsewhere in any one of the row, column or block of the triple context of the cell under consideration). A full pass of the Sudoku grid should be made, filling cells with their valid values where possible, and further passes should occur until no cell is solved in a pass. Each time a cell is solved, the other candidate lists in its triple context should immediately be updated by removing the found value from their candidate lists. The number of passes through the grid and the number of cells solved by these two simple logic principles will vary depending on the number and pattern of pre-defined values in the initial data. A number of data-file puzzles will be provided and your software performance should be measured for each of them. You are required to implement code to determine: for each initial data set, how many cells are solved; how many passes through the grid are required; what is the total number of candidate values considered (e.g., increment a counter every time your code inspects a member of a candidate list in any cell, in any pass).

this is my brief

/r/learnprogramming Thread Parent