GithubHelp home page GithubHelp logo

sabinpocris / k-clique--sat Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 16 KB

Implementare programatic a unei reduceri a problemei K–CLIQUE la SAT.

License: GNU General Public License v3.0

Python 99.07% Makefile 0.93%

k-clique--sat's Introduction

Tema 2 AA - Pocris Sabin 322CB

TL;DR

Pentru aceasta tema, am ales sa sa adaug variabilele reducerii SAT intr-un hashmap, mai concret intr-un dictionar, intrucat am realizat tema in Python).

Oricare variabila $x_{ij}$, cu semnificatia ca al $i$-lea nod din clica este nodul $v$, are asociat in hasmap un string de forma "i,j".

Graful este reprezentat de o matrice de adiacenta.

Descrierea programului

In primul rand, am ales sa citesc din fisier si sa construiesc matricea de adiacenta, ce reprezinta graful. Urmatorul pas a fost sa construiesc hashmap-ul ce asociaza fiecarei variabile din SAT un string de forma "i,j".

Am construit 3 bucle, una pentru fiecare conditie din enuntul reducerii, pentru a construii clauzele necesare:

  1. există un al $i$-elea nod în clica
  2. toate elementele clicii sunt unice
  3. oricare doua noduri din clica să aibă muchie între ele

In final, adaug datele necesare formatului DIMACS si scriu clauzele generate mai sus in fisierul de output.

k-clique--sat's People

Contributors

sabinpocris avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.