Coder Social home page Coder Social logo

pratyushvm / maxflow-cuda Goto Github PK

View Code? Open in Web Editor NEW
26.0 1.0 9.0 1.49 MB

Implementation of the maximum network flow problem in CUDA.

License: GNU General Public License v3.0

C++ 24.49% Cuda 68.97% Makefile 6.54%
maxflow maxflow-mincut cuda push-relabel preflow-push maximum-flow maximum-flow-algorithm maximum-flow-problem maxflow-cuda relabel-algorithm

maxflow-cuda's Introduction

maxflow-cuda

Implementation of the maximum network flow problem in CUDA. Uses the parallel push-relabel algorithm, as illustrated in this paper .

The program depicts the values of height, excess flow and the residual flow for each node at each iteration, along with the maximum flow obtained. It also runs a serial version of the push relabel algorithm and verifies the output.

Execution :

To build the project, run :
make

To run the algorithm :
./maxflow <number of vertices> <number of edges> <source vertex> <sink vertex>

In file "edgelist.txt", edge input to be given in the form :
<end of edge 0> <end of edge 0> <capacity of edge 0>
<end of edge 1> <end of edge 1> <capacity of edge 1>
<end of edge 2> <end of edge 2> <capacity of edge 2>
...

To clean, run :
make clean

Contents

  1. Makefile
  2. include -
    • serial_graph.h - for the serial implementation
    • parallel_graph.cuh - for the parallel implementation

3.src -

  • graph_s.cpp - contains functions used by the serial check
  • io_par.cu - contains the input function and the print function used after each iteration
  • preflow.cu - contains the preflow/Init routine
  • push_relabel.cu - contains the host push relabel routine
  • push_relabel_kernel.cu - contains the kernel invoked as part of the push_relabel routine
  • global_relabel.cu - contains the heuristic host global relabel routine

References

  1. Efficient CUDA Algorithms for the Maximum Network Flow Problem
  2. http://www.cse.iitm.ac.in/~rupesh/teaching/gpu/jan20/
  3. https://www.geeksforgeeks.org/push-relabel-algorithm-set-2-implementation/
  4. Parallel implementation of flow and matching algorithms - Agnieszka Łupińska, Jagiellonian University, Kraków
  5. https://www.geeksforgeeks.org/ford-fulkerson-algorithm-for-maximum-flow-problem/

maxflow-cuda's People

Contributors

pratyushvm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

maxflow-cuda's Issues

The arguments of main.cu

Hi Pratyush,

Thanks for sharing this implementation.
Currently, I am studying push-relabel algorithm, and I would like to try running the code you share.
What is the Vertices(V), edges(E), source, and sink would be, if I use the example of edgelist.txt?

Best,
Lin

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.