The Max-Flow Project is an implementation of the max flow algorithm, utilizing both Python and C++ languages. This project showcases the integration of the two languages, compiled with CMake, and includes a Jupyter notebook example for demonstration purposes.
The max flow algorithm is used to find the maximum flow in a directed flow network. This project implements the algorithm using C++ for the core computations and Python for the interface and additional functionalities. The Jupyter notebook included in this project provides an interactive example to demonstrate how to use this project.
- Implementation of the max flow algorithm in C++
- Python interface for easier interaction
- Jupyter notebook example to demonstrate usage
- CMake build system for compiling the C++ code
- Python 3.x
- C++ compiler (e.g., g++)
- CMake
-
Clone the repository:
git clone https://github.com/thenchoz/MaxFlow.git cd MaxFlow -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate -
Install Python dependencies:
pip install -r python/requirements.txt
-
Compile the C++ code using CMake:
mkdir build cd build cmake .. make
-
Ensure the virtual environment is activated:
source venv/bin/activate -
Go in the
pythonfolder:cd python -
Run graph_analysis:
python graph_analysis.py --help
The Jupyter notebook MaxFlow_example.ipynb contains an example of how to use the max flow algorithm implemented in this project. It provides a step-by-step guide to demonstrate the setup, execution, and visualization of the algorithm.
-
Ensure the virtual environment is activated:
source venv/bin/activate -
Run the Jupyter notebook:
jupyter notebook
-
Open the
MaxFlow_example.ipynbnotebook and run the cells to see the max flow algorithm in action.