This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pysat.formula import CNF, IDPool | |
from pysat.solvers import Solver | |
from pysat.card import CardEnc | |
from pysat.pb import PBEnc, EncType | |
from rich import print | |
from rich.text import Text | |
""" | |
Problem Definition: | |
------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pysat.card | |
from pysat.card import CardEnc | |
from pysat.formula import CNF, IDPool | |
from pysat.solvers import Solver | |
from pysat.pb import * | |
import networkx as nx | |
from networkx.algorithms.approximation import greedy_tsp | |
""" | |
This script demonstrates a potential use case of SAT solver interfaces, employing dynamic clause addition lazily during |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from plumbum import local | |
from pysat.formula import CNF | |
from pysat.solvers import Solver | |
import os | |
import uuid | |
from pysat.card import CardEnc, EncType | |
from multiprocessing import Pool | |
""" | |
This script demonstrates a basic adaptation of parallel/distributed SAT solving. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pysat.solvers import Solver | |
from pysat.formula import IDPool | |
import networkx as nx | |
import drup | |
""" | |
This script demonstrates basic SAT/UNSAT instance verification using SAT solvers. | |
We apply it to the graph coloring problem. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import tempfile | |
import os | |
from itertools import combinations | |
import pysat.formula | |
from pysat.formula import IDPool | |
from pysat.solvers import Solver | |
""" | |
This script demonstrates the potential benefits of preprocessing techniques, such as (static) symmetry breaking, in SAT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pysat.card import CardEnc, EncType | |
from pysat.formula import CNF | |
from pysat.solvers import Solver | |
import matplotlib.pyplot as plt | |
import numpy as np | |
def plot(queen_positions,n,gamma): | |
# Visualization | |
fig, ax = plt.subplots(figsize=(6, 6)) | |
ax.set_xticks([]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pysat.solvers import Solver | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import math | |
from pysat.formula import * | |
""" | |
Log-Based SAT Encoding for the Queen Domination Problem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
from pysat.examples.rc2 import RC2 | |
from pysat.formula import WCNF | |
from pysat.formula import IDPool | |
import networkx as nx | |
import numpy as np | |
G=np.array([[0,1,0,0,0,1], | |
[1,0,1,1,1,1], | |
[0,1,0,0,0,0], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
from pysat.examples.rc2 import RC2 | |
from pysat.formula import WCNF | |
from pysat.formula import IDPool | |
import rustworkx.generators | |
from rustworkx.visualization import mpl_draw | |
G = rustworkx.generators.generalized_petersen_graph(12, 4) | |
vpool = IDPool(start_from=1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import networkx as nx | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from pysat.examples.rc2 import RC2 | |
from pysat.formula import WCNF | |
from pysat.formula import IDPool | |
G=np.array([[0,1,1,1,0,1,0], | |
[1,0,1,0,1,0,1], | |
[1,1,0,1,1,0,0], |
NewerOlder