static void IndependentSetProblem() { PrintIndependentSetUsage(); IndependentSetProblem problem = new IndependentSetProblem(); problem.ReadInput(Console.In); CNF problemCNF = problem.ConvertToCNF(); DPLL problemDPLL = new DPLL(); Task <DPLLResultHolder> parallelSAT = problemDPLL.SatisfiableParallel(problemCNF); parallelSAT.Wait(); Console.WriteLine(); Console.WriteLine(problem.InterpretDPLLResult(parallelSAT.Result)); }
static void HamiltonianPathProblem() { PrintHamiltonianPathUsage(); HamiltonianPathProblem problem = new HamiltonianPathProblem(); problem.ReadInput(Console.In); CNF problemCNF = problem.ConvertToCNF(); DPLL problemDPLL = new DPLL(); Task <DPLLResultHolder> parallelSAT = problemDPLL.SatisfiableParallel(problemCNF); parallelSAT.Wait(); Console.WriteLine(); Console.WriteLine(problem.InterpretDPLLResult(parallelSAT.Result)); }
static void ThreeColorabilityProblem() { Print3ColorabilityUsage(); ThreeColorabilityProblem problem = new ThreeColorabilityProblem(); problem.ReadInput(Console.In); CNF problemCNF = problem.ConvertToCNF(); DPLL problemDPLL = new DPLL(); Task <DPLLResultHolder> parallelSAT = problemDPLL.SatisfiableParallel(problemCNF); parallelSAT.Wait(); Console.WriteLine(); Console.WriteLine(problem.InterpretDPLLResult(parallelSAT.Result)); }
static void SATSolver() { PrintSATSolverUsage(); CNF cnf = new CNF(); cnf.ReadFormula(Console.In); // Sequential solution /*CNF cnfCopy = new CNF(cnf); * DPLL sequentialDPLL = new DPLL(); * DPLLResultHolder sequentialResult = sequentialDPLL.Satisfiable(cnfCopy); * Console.WriteLine(); * Console.WriteLine(sequentialResult);*/ // Parallel solution DPLL parallelDPLL = new DPLL(); Task <DPLLResultHolder> parallelSAT = parallelDPLL.SatisfiableParallel(cnf); parallelSAT.Wait(); Console.WriteLine(); Console.WriteLine(parallelSAT.Result); }