This repository contains a project realized as part of the Combinatorial Decision Making and Optimization course exam of the Master's degree in Artificial Intelligence, University of Bologna.
VLSI (Very Large Scale Integration) refers to the trend of integrating circuits into silicon chips. The problem is to design the VLSI of the circuits defining your electrical device: given a fixed-width plate and a list of rectangular circuits, decide how to place them on the plate so that the length of the final device is minimized (improving its portability). Different solution in CP, SAT and SMT have been developed.
.
βββ assets
β βββ results # Plots of the numerical results
β βββ img # Images used in the report
βββ data
β βββ instances_txt # Input instances in txt format
βββ CP # Folder containing all CP files
β βββ benchmarks # Folder containing excel sheets to compare results of different search parameters
β βββ instances_dzn # Input instances for CP in dzn format
β βββ out # Outputs of the execution of instances with CP
β βββ src
β β βββ model_final.mzn # The model which produces the best resuls in CP
β β βββ model_rotation.mzn # The model which allows also to rotate circuits
β β βββ model_symmetries.mzn # The model which implements symmetries breaking constraints
β β βββ solve_cp_instances.py # Script to solve all instrances in CP
β β βββ solve_instance.py # Script to solve a single instrance in CP
β βββ CP_report.pdf # Report about the CP solution
βββ SAT # Folder containing all SAT files
β βββ out # Outputs of the execution of instances with SAT
β βββ src
β β βββ model_final.mzn # The model which produces the best resuls in SAT
β β βββ model_rotation.mzn # The model which allows also to rotate circuits
β β βββ model_symmetries.mzn # The model which implements symmetries breaking constraints
β β βββ model_bimander.mzn # The model which implements the alternative at-most-one encoding
β β βββ solve_sat_instances.py # Script to solve all instrances in SAT
β β βββ sat_utils.py # Utility functions for SAT
β βββ SAT_report.pdf # Report about the SAT solution
βββ SMT # Folder containing all SMT files
β βββ out # Outputs of the execution of instances with SMT
β βββ src
β β βββ model_final.mzn # The model which produces the best resuls in SMT
β β βββ model_rotation.mzn # The model which allows also to rotate circuits
β β βββ solve_smt_instances.py # Script to solve all instrances in SMT
β βββ SMT_report.pdf # Report about the SMT solution
βββ utils
β βββ instances_to_dzn.py # Script to convert input instances from txt to dzn
β βββ plot_solution.py # Script to visualize a specific output
β βββ show_results.py # Script to plot the times to get results for all instances
βββ assigment.pdf
βββ LICENSE
βββ README.md
It is required to install Minizinc and add the executable to the environment variable PATH. In order to execute SAT and SMT solution the Z3 theorem prover for python is required.
The easiest way to install Z3Py, along with the Z3 binary, is to use Python's package manager pip:
pip install z3-solver
In order to visualize solutions, you can use the script plot_solution.py
.
It is required to pass as parameter the output file, eg:
python plot_solution.py -f <solution file path>
An example of output is as follows:
In order to create a barchart of the times of execution of different instances, you can use the script show_results.py
.
Enter on utils
Open file show_results.py
In main() [line 106] modify:
column_names = <list of models names> (e.g. ['rotation','final','symmetries'])
directories = <list of output folder for the models> (e.g. ["../SAT/out/rotation","../SAT/out/final","../SAT/out/symmetries"])
num = <maximum of instances that can be plotted>
title = <title of image>
Then run the file
python show_results.py
In order to convert .txt instances into .dzn instances, run
python instances_to_dzn.py
We use Git for versioning.
Reg No. | Name | Surname | Username | |
---|---|---|---|---|
997317 | Giuseppe | Murro | giuseppe.murro@studio.unibo.it |
gmurro |
985203 | Salvatore | Pisciotta | salvatore.pisciotta2@studio.unibo.it |
SalvoPisciotta |
1005271 | Giuseppe | Boezio | giuseppe.boezio@studio.unibo.it |
giuseppeboezio |
This project is licensed under the MIT License - see the LICENSE file for details