| 1 | // graph-tool -- a general graph modification and manipulation thingy |
|---|
| 2 | // |
|---|
| 3 | // Copyright (C) 2007 Tiago de Paula Peixoto <tiago@forked.de> |
|---|
| 4 | // |
|---|
| 5 | // This program is free software; you can redistribute it and/or |
|---|
| 6 | // modify it under the terms of the GNU General Public License |
|---|
| 7 | // as published by the Free Software Foundation; either version 3 |
|---|
| 8 | // of the License, or (at your option) any later version. |
|---|
| 9 | // |
|---|
| 10 | // This program is distributed in the hope that it will be useful, |
|---|
| 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 | // GNU General Public License for more details. |
|---|
| 14 | // |
|---|
| 15 | // You should have received a copy of the GNU General Public License |
|---|
| 16 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 17 | |
|---|
| 18 | #include <boost/python.hpp> |
|---|
| 19 | #include "graph.hh" |
|---|
| 20 | |
|---|
| 21 | using namespace boost; |
|---|
| 22 | using namespace boost::python; |
|---|
| 23 | using namespace graph_tool; |
|---|
| 24 | |
|---|
| 25 | bool check_isomorphism(GraphInterface& gi1, GraphInterface& gi2, |
|---|
| 26 | boost::any iso_map); |
|---|
| 27 | |
|---|
| 28 | bool get_kruskal_spanning_tree(GraphInterface& gi, boost::any weight_map, |
|---|
| 29 | boost::any tree_map); |
|---|
| 30 | |
|---|
| 31 | bool get_prim_spanning_tree(GraphInterface& gi, size_t root, |
|---|
| 32 | boost::any weight_map, boost::any tree_map); |
|---|
| 33 | |
|---|
| 34 | void topological_sort(GraphInterface& gi, vector<int32_t>& sort); |
|---|
| 35 | |
|---|
| 36 | bool denominator_tree(GraphInterface& gi, size_t entry, boost::any pred_map); |
|---|
| 37 | |
|---|
| 38 | void transitive_closure(GraphInterface& gi, GraphInterface& tcgi); |
|---|
| 39 | |
|---|
| 40 | void export_components(); |
|---|
| 41 | |
|---|
| 42 | BOOST_PYTHON_MODULE(libgraph_tool_topology) |
|---|
| 43 | { |
|---|
| 44 | def("check_isomorphism", &check_isomorphism); |
|---|
| 45 | def("get_kruskal_spanning_tree", &get_kruskal_spanning_tree); |
|---|
| 46 | def("get_prim_spanning_tree", &get_prim_spanning_tree); |
|---|
| 47 | def("topological_sort", &topological_sort); |
|---|
| 48 | def("denominator_tree", &denominator_tree); |
|---|
| 49 | def("transitive_closure", &transitive_closure); |
|---|
| 50 | export_components(); |
|---|
| 51 | } |
|---|