Detailed project report: Yannik_Kopyciok_VC_project_report.pdf
This project contains code to run the integer linear programming (ILP) optimization described in the above mentioned report.
The following packages are required to run this project:
- gurobipy 10.0.1
- numpy 1.24.3
- scipy 1.10.1
- networkx 3.1
- matplotlib 3.7.1
- pandas 2.0.3
The following files are included in this project:
- [fullILP.py]
- [fullILPUtils.py]
- [constants.py]
- [lightningMiniatureGen.py]
- [randGraphGenerator.py]
- Register for a GurobiPy license (free for academia) and install the library as described on their website.
- Install the required packages.
- Run the ILP as follows:
- Open
constants.pyand change theGRAPH_SIZES_LBandGRAPH_SIZES_UBto the number of nodes you want to run the ILP on. - Specify how many unique transactions should be constructed by adjusting the
NUMBER_OF_TRXSvariable (default: 5). - Specify if and how often those transactions should be repeated by adjusting the
REPETITIONSvariable. Each number of repetition will create a set of transactions. For example, if you setREPETITIONSto 4 andNUMBER_OF_TRXSto 5, 4 sets of transactions will be created. The first contains only the 5 unique transactions, the second one contains the 5 unique transactions two times, and so on. - Set
GRAPH_TOPOLOGYtoLN_MINIATURE. - Open the file
lightningMiniatureGen.pyand run it (depending on lower and upper bound, this might take a while). - Open the file
fullILP.pyand run it. When you created several repetitions, the ILP will always only run for one set of transactions. Which set it should run for can be adjusted with the variableNUMBER_OF_TRXS, which can be adjusted along the above example to 5, 10, 15, and 20. - The results are saved in
results.txtand can be visualized withresultGen.py. The default will plot the runtime of the prerequisites relative to the number of nodes.
- Open
ILP for the unique graph which is visualized in the project report with a set of 10 transactions (5 unique ones)
- Change the variable
GRAPH_TOPOLOGYinconstants.pytoUNIQ. - If you want the network to be visualized, change
DRAWINGtoTrue. Remember to set it toFalseafterwards; otherwise, when running sets, every graph will be visualized. - Open
fullILP.pyand run the ILP.
This project is licensed under the MIT License. See the LICENSE file for details.