private void AddChild(int possibility, ICSPSolvable currentNode, CSPNode mostLimited)
        {
            ICSPSolvable nodeClone = currentNode.DeepClone();

            nodeClone.AssignNewDataAndUpdateDomains(mostLimited.xIndex, mostLimited.yIndex, possibility);

            CreateChildren(nodeClone);
        }
        private void AddChild(int possibility, ICSPSolvable currentNode, CSPNode mostLimited)
        {
            ICSPSolvable nodeClone = currentNode.DeepClone();

            nodeClone.AssignNewDataAndUpdateDomains(mostLimited.xIndex, mostLimited.yIndex, possibility);

            if (!nodeClone.IsAnyOfDomainsEmpty())
            {
                CreateChildren(nodeClone);
            }
            else
            {
                numberOfIterations++;
            }
        }
        private void CreateChildren(ICSPSolvable currentNode)
        {
            CSPNode mostLimited = currentNode.ChooseElementByHeuristics();

            if (mostLimited == null)
            {
                CheckIfWonWhenNoElementsLeft(currentNode);
            }
            else
            {
                List <int> allPossibilities = mostLimited.domain;

                ParallelOptions options = new ParallelOptions();
                options.MaxDegreeOfParallelism = 4;

                Parallel.ForEach(allPossibilities, options, (i) =>
                {
                    AddChild(i, currentNode, mostLimited);
                });
            }
        }
        private void AddChildenForEveryPossibility(List <int> allPossibilities, ICSPSolvable currentNode, CSPNode mostLimited)
        {
            for (int i = 0; i < allPossibilities.Count; i++)
            {
                ICSPSolvable nodeClone = currentNode.DeepClone();
                nodeClone.AssignNewDataAndUpdateDomains(mostLimited.xIndex, mostLimited.yIndex, allPossibilities[i]);

                if (!nodeClone.IsAnyOfDomainsEmpty())
                {
                    CreateChildren(nodeClone);
                }
            }
        }
        private void AddChildenForEveryPossibility(List <int> allPossibilities, ICSPSolvable currentNode, CSPNode mostLimited)
        {
            for (int i = 0; i < allPossibilities.Count; i++)
            {
                ICSPSolvable CSPNodeClone = currentNode.DeepClone();
                CSPNodeClone.AssignNewData(mostLimited.xIndex, mostLimited.yIndex, allPossibilities[i]);

                CreateChildren(CSPNodeClone);
            }
        }