deba@2420: /* -*- C++ -*-
deba@2420:  *
deba@2420:  * This file is a part of LEMON, a generic C++ optimization library
deba@2420:  *
deba@2420:  * Copyright (C) 2003-2007
deba@2420:  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
deba@2420:  * (Egervary Research Group on Combinatorial Optimization, EGRES).
deba@2420:  *
deba@2420:  * Permission to use, modify and distribute this software is granted
deba@2420:  * provided that this copyright notice appears in all copies. For
deba@2420:  * precise terms see the accompanying LICENSE file.
deba@2420:  *
deba@2420:  * This software is provided "AS IS" with no warranty of any kind,
deba@2420:  * express or implied, and with no claim as to its suitability for any
deba@2420:  * purpose.
deba@2420:  *
deba@2420:  */
deba@2420: 
deba@2420: /// \ingroup demos
deba@2420: /// \file
deba@2420: /// \brief Solver for SAT-2 problems.
deba@2420: ///
deba@2420: /// This demo progam solves the SAT-2 problem, i.e. the boolean
deba@2420: /// satisfiability problem where each disjuction consists at most 2
deba@2420: /// terms.
deba@2420: ///
deba@2420: /// The program generates a graph from the boolean expression. Two
deba@2420: /// nodes are assigned to each boolean variable, an x and a
deba@2420: /// not x nodes. If there is an x or y disjunction
deba@2420: /// in the formula, then the not x => y and the not y =>
deba@2420: /// x edges are added to the graph. If there is a single
deba@2420: /// x term disjunction in the formula then the not x
deba@2420: /// =>x edge is added to the graph.
deba@2420: ///
deba@2420: /// The boolean formula could be satified if and only if the
deba@2420: /// x and not x nodes are in different strongly connected
deba@2420: /// components. A feasible solution could be get from the current
deba@2420: /// component numbering.
deba@2420: ///
deba@2420: /// \include sat-2.cc
deba@2420: 
deba@2420: #include 
deba@2420: #include 
deba@2420: #include 
deba@2420: #include 
deba@2420: #include