Giter Site home page Giter Site logo

maxflow-3.0.4's Introduction

MAXFLOW - software for computing mincut/maxflow in a graph

Version 3.04

The original implementation can be found at

 http://pub.ist.ac.at/~vnk/software.html

and was implemented by

 Yuri Boykov ([email protected])
 Vladimir Kolmogorov ([email protected]) 
 2001-2006

Introduction.

This software library implements the maxflow algorithm described in

"An Experimental Comparison of Min-Cut/Max-Flow Algorithms 
     for Energy Minimization in Vision."
Yuri Boykov and Vladimir Kolmogorov.
In IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), 
September 2004
    http://dx.doi.org/10.1109/TPAMI.2004.60

This algorithm was developed by Yuri Boykov and Vladimir Kolmogorov at Siemens Corporate Research. To make it available for public use, it was later reimplemented by Vladimir Kolmogorov based on open publications.

If you use this software for research purposes, you should cite the aforementioned paper in any resulting publication.


Reusing trees

Starting with version 3.0, there is a also an option of reusing search trees from one maxflow computation to the next, as described in

"Efficiently Solving Dynamic Markov Random Fields Using Graph Cuts."
Pushmeet Kohli and Philip H.S. Torr
International Conference on Computer Vision (ICCV), 2005

If you use this option, you should cite the aforementioned paper in any resulting publication.

Tested under windows, Visual C++ 6.0 compiler and unix (SunOS 5.8 and RedHat Linux 7.0, Gentoo Linux, GNU C++ compiler).

License & disclaimer.

Copyright 2001-2006 Vladimir Kolmogorov ([email protected]), Yuri Boykov ([email protected]).

This software is under the GPL license.
If you require another license, you may consider using version 2.21
(which implements exactly the same algorithm, but does not have
 the option of reusing search trees).

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Example usage.

This section shows how to use the library to compute a minimum cut on the following graph:

     SOURCE
    /       \
  1/         \2
  /      3    \
node0 -----> node1
 |   <-----   |
 |      4     |
 \            /
 5\          /6
   \        /
      SINK

#include <stdio.h>
#include <maxflow/graph.h>

int main()
{
typedef Graph<int,int,int> GraphType;
GraphType *g = new GraphType(/*estimated # of nodes*/ 2, /*estimated # of edges*/ 1); 

g -> add_node(); 
g -> add_node(); 

g -> add_tweights( 0,   /* capacities */  1, 5 );
g -> add_tweights( 1,   /* capacities */  2, 6 );
g -> add_edge( 0, 1,    /* capacities */  3, 4 );

int flow = g -> maxflow();

printf("Flow = %d\n", flow);
printf("Minimum cut:\n");
if (g->what_segment(0) == GraphType::SOURCE)
	printf("node0 is in the SOURCE set\n");
else
	printf("node0 is in the SINK set\n");
if (g->what_segment(1) == GraphType::SOURCE)
	printf("node1 is in the SOURCE set\n");
else
	printf("node1 is in the SINK set\n");

delete g;

return 0;
}

Additional notes

The build system, unit tests, and creation of a shared library was done by Gert Wollny [email protected] here in this github repository.

maxflow-3.0.4's People

Contributors

gerddie avatar

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.