graph_flow_bind.cc 1.91 KB
Newer Older
Tiago Peixoto's avatar
Tiago Peixoto committed
1 2
// graph-tool -- a general graph modification and manipulation thingy
//
Tiago Peixoto's avatar
Tiago Peixoto committed
3
// Copyright (C) 2006-2016 Tiago de Paula Peixoto <tiago@skewed.de>
Tiago Peixoto's avatar
Tiago Peixoto committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

#include "graph.hh"

using namespace graph_tool;
using namespace boost;

void edmonds_karp_max_flow(GraphInterface& gi, size_t src, size_t sink,
                           boost::any capacity, boost::any res);
void push_relabel_max_flow(GraphInterface& gi, size_t src, size_t sink,
                           boost::any capacity, boost::any res);
void kolmogorov_max_flow(GraphInterface& gi, size_t src, size_t sink,
                         boost::any capacity, boost::any res);
29
bool max_cardinality_matching(GraphInterface& gi, boost::any match);
30
double min_cut(GraphInterface& gi, boost::any weight, boost::any part_map);
31 32
void get_residual_graph(GraphInterface& gi, boost::any capacity, boost::any res,
                        boost::any oaugment);
Tiago Peixoto's avatar
Tiago Peixoto committed
33 34 35 36 37 38 39 40 41

#include <boost/python.hpp>
using namespace boost::python;

BOOST_PYTHON_MODULE(libgraph_tool_flow)
{
    def("edmonds_karp_max_flow", &edmonds_karp_max_flow);
    def("push_relabel_max_flow", &push_relabel_max_flow);
    def("kolmogorov_max_flow", &kolmogorov_max_flow);
42
    def("max_cardinality_matching", &max_cardinality_matching);
43
    def("min_cut", &min_cut);
44
    def("residual_graph", &get_residual_graph);
Tiago Peixoto's avatar
Tiago Peixoto committed
45
}