forked from Smorodov/Multitarget-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmincut.h
More file actions
92 lines (70 loc) · 1.5 KB
/
mincut.h
File metadata and controls
92 lines (70 loc) · 1.5 KB
1
2
3
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// $Id: mincut.h,v 1.1.1.1 2003/11/05 15:19:13 rdmp1c Exp $
#ifndef MINCUT_H
#define MINCUT_H
#include <GTL/algorithm.h>
/**
* @typedef node_pair
* A pair of nodes
*/
typedef std::pair<node, node> node_pair;
class GTL_EXTERN mincut : public algorithm
{
public:
mincut ();
virtual ~mincut();
/**
* Sets weight of every edge for mincut calculation.
*
* @param <code>edge_weight</code> weight of every edge.
*/
void set_vars(const edge_map<int>& edge_weight);
/**
* Finds a mincut of G.
*
* @param <code>G</code> graph.
* @return <code>algorithm::GTL_OK</code> on success,
* <code>algorithm::GTL_ERROR</code> otherwise.
* @see algorithm#run
*/
int run (graph& G);
/**
* Checks whether the preconditions for mincut are satisfied.
*
* @param <code>G</code> graph.
* @return <code>algorithm::GTL_OK</code> on success,
* <code>algorithm::GTL_ERROR</code> otherwise.
* @see algorithm#check
*/
virtual int check (graph& G);
/**
* Reset.
*
* @see algorithm#reset
*/
virtual void reset ();
/**
* Returns the mincut for the graph G.
*
* @return mincut value
*
*/
int get_mincut() const { return min_cut; };
protected:
/**
* @internal
*/
int min_cut;
/**
* @internal
*/
bool set_vars_executed;
/**
* @internal
*/
edge_map<int> edge_weight;
/**
* @internal
*/
std::list<node_pair> st_list;
};
#endif