Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
FordFulkerson.hpp
Go to the documentation of this file.
1
6// Copyright (c) 2017 Czech Technical University in Prague | Faculty of Information Technology. All rights reserved.
7
8#pragma once
9
10#include <unordered_set>
11
13#include <node/NodeClasses.hpp>
14#include <edge/EdgeClasses.hpp>
15
16namespace std {
17template<>
18struct hash<std::pair<node::Node, node::Node> > {
19 std::size_t operator()(const std::pair<node::Node, node::Node> &p) const {
20 return std::hash<std::string>()(ext::to_string(p.first) + ext::to_string(p.second));
21 }
22};
23}
24
25// =====================================================================================================================
26
27namespace graph {
28
29namespace minimum_cut {
30
31typedef std::unordered_set<std::pair<node::Node, node::Node> > Cut;
32
33// Old implementation without templates
36
38 public:
39// ---------------------------------------------------------------------------------------------------------------------
40
42 const node::Node &source,
43 const node::Node &sink);
44
46 const node::Node &source,
47 const node::Node &sink);
48
49// ---------------------------------------------------------------------------------------------------------------------
50
51};
52
53// =====================================================================================================================
54
55
56// ---------------------------------------------------------------------------------------------------------------------
57
58} // namespace minimum_cut
59
60} // namespace graph
61
Definition: DirectedGraph.hpp:26
Definition: UndirectedGraph.hpp:26
Definition: FordFulkerson.hpp:37
static Cut findMinimumCut(const DirectedGraph &graph, const node::Node &source, const node::Node &sink)
Definition: FordFulkerson.cpp:127
Definition: Node.hpp:17
std::string to_string(const T &value)
To string method designated for objects that can be casted to string.
Definition: string.hpp:131
std::unordered_set< std::pair< node::Node, node::Node > > Cut
Definition: FordFulkerson.hpp:31
Definition: ReconstructPath.hpp:14
Definition: FordFulkerson.hpp:16
std::size_t operator()(const std::pair< node::Node, node::Node > &p) const
Definition: FordFulkerson.hpp:19