# Intel® Threading Building Blocks.
Sudoku sample

This directory contains a simple example that finds all solutions to a Sudoku board.
It uses a straightforward state-space search algorithm that exhibits OR-parallelism. It can be optionally run until it obtains just the first solution. The point of the example is to teach how to use the task_group interface.
The example can be built in the offload version to run on Intel® Many Integrated Core (Intel® MIC) Architecture based coprocessor (see build instructions).

System Requirements

For the most up to date system requirements, see the release notes.

Files

sudoku.cpp
  Driver.
input1
  Sample input file with modest number of solutions.
input2
  Sample input file with small number of solutions.
input3
  Sample input file with larger number of solutions.
input4
  Sample input file with very large number of solutions.
Makefile
  Makefile for building the example.

Directories

msvs
  Contains Microsoft* Visual Studio* workspace for building and running the example with the Intel® C++ Compiler (Windows* systems only).
xcode
  Contains Xcode* IDE workspace for building and running the example (OS X* systems only).

For information about the minimum supported version of IDE, see release notes.

Build instructions

General build directions can be found here.

Usage

`sudoku -h`
  Prints the help for command line options
`sudoku [n-of-threads=value] [filename=value] [verbose] [silent] [find-one]`
`sudoku [n-of-threads [filename]] [verbose] [silent] [find-one]`
  n-of-threads is the number of threads to use; a range of the form low[:high], where low and optional high are non-negative integers or 'auto' for the TBB default.
  filename is an input filename.
  verbose - prints the first solution.
  silent - no output except elapsed time.
  find-one - stops after finding first solution.
To run a short version of this example, e.g., for use with Intel® Parallel Inspector:
  Build a debug version of the example (see the build instructions).
  Run it with a small problem size and the desired number of threads, e.g., `sudoku 4 input2`.

Up to parent directory

Legal Information

Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.
* Other names and brands may be claimed as the property of others.
© 2016, Intel Corporation