Open a terminal and move to the QAOA/
directory where the project files are located:
cd QAOA/
Ensure you have python3.9
installed. Create an isolated Python environment to manage dependencies:
python3.9 -m venv .venv
Activate the environment to ensure all installations and executions are contained within it. For example, in Linux/macOS:
source .venv/bin/activate
Use pip
to install all necessary dependencies from the requirements.txt
file:
pip install -r requirements.txt
Use the clique_QAOA.py
script to run test cases. Replace the placeholders [inputfile]
, [answerfile]
, and [reps]
with your input data:
- [inputfile]: The path to the file containing the graph data.
- [answerfile]: The file where the computed results will be validated against.
- [reps]: Number of repetitions (layers ( p )) for QAOA.
A script run.sh
is provided to conduct experiments.
Make sure that you have granted execution permission before executing
chmod +x run.sh
You could run it with
./run.sh
Once finished, deactivate the virtual environment to return to your default Python environment:
deactivate
The first line contains two integers,
The next
The first line contains one integer
Input
6 7
0 1
1 2
0 2
3 4
4 5
3 5
1 4
This describes a graph with six vertices and seven edges. Vertices
Output
3
0 1 2
1 4
3 4 5
This indicates that there are three maximal cliques: [0, 1, 2], [1, 4], and [3, 4, 5].
-
custom_testcases: Contains small test cases for debugging.
-
normal_testcases: Contains test cases with
$V$ ranging from$4$ to$35$ . -
all_connected_testcases: Contains test cases with
$V$ ranging from$4$ to$35$ , where all vertices are adjacent to each others.