|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Examples of the Two_Sat solver. More...
#include <iostream>#include <string>#include <Two_Sat.H>#include <tpl_sgraph.H>#include <tpl_agraph.H>Go to the source code of this file.
Functions | |
| void | example_basic_formula () |
| void | example_signed_api () |
| void | example_2_coloring () |
| void | example_team_assignment () |
| void | example_graph_backends () |
| int | main () |
Examples of the Two_Sat solver.
Demonstrates four applications of 2-SAT:
2-SAT is the problem of determining whether a Boolean formula in conjunctive normal form (CNF), where each clause has exactly two literals, is satisfiable.
Example formula: (x0 OR x1) AND (~x0 OR x2) AND (~x1 OR ~x2)
The solver builds an implication graph and uses Tarjan's SCC algorithm. Each clause (a OR b) produces two implications: ~a -> b and ~b -> a. The formula is unsatisfiable iff some variable and its negation lie in the same SCC.
Definition in file two_sat_example.cc.
| void example_2_coloring | ( | ) |
Definition at line 162 of file two_sat_example.cc.
References Aleph::divide_and_conquer_partition_dp().
Referenced by main().
| void example_basic_formula | ( | ) |
Definition at line 81 of file two_sat_example.cc.
References Aleph::divide_and_conquer_partition_dp().
Referenced by main().
| void example_graph_backends | ( | ) |
Definition at line 279 of file two_sat_example.cc.
References Aleph::divide_and_conquer_partition_dp().
Referenced by main().
| void example_signed_api | ( | ) |
Definition at line 122 of file two_sat_example.cc.
References Aleph::divide_and_conquer_partition_dp().
Referenced by main().
| void example_team_assignment | ( | ) |
Definition at line 231 of file two_sat_example.cc.
References Aleph::divide_and_conquer_partition_dp().
Referenced by main().
| int main | ( | ) |
Definition at line 326 of file two_sat_example.cc.
References example_2_coloring(), example_basic_formula(), example_graph_backends(), example_signed_api(), and example_team_assignment().