!
!
!
1
1
42
42
2
2
1
1
2
2
10
10
4
3
1
1
7
7
92
92
10
10
2
2
45
45
6
6
47
47
2
2
4
4
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -277,3 +277,3 @@ |
| 277 | 277 |
|
| 278 |
- \ref Dijkstra Dijkstra's algorithm for finding shortest paths from a |
|
| 278 |
- \ref Dijkstra Dijkstra's algorithm for finding shortest paths from a |
|
| 279 | 279 |
source node when all arc lengths are non-negative. |
| ... | ... |
@@ -308,3 +308,3 @@ |
| 308 | 308 |
|
| 309 |
\ref Circulation is a preflow push-relabel algorithm implemented directly |
|
| 309 |
\ref Circulation is a preflow push-relabel algorithm implemented directly |
|
| 310 | 310 |
for finding feasible circulations, which is a somewhat different problem, |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -83,3 +83,3 @@ |
| 83 | 83 |
then \f$\pi(u)=0\f$. |
| 84 |
|
|
| 84 |
|
|
| 85 | 85 |
Here \f$cost^\pi(uv)\f$ denotes the \e reduced \e cost of the arc |
| ... | ... |
@@ -121,3 +121,3 @@ |
| 121 | 121 |
|
| 122 |
It means that the total demand must be less or equal to the |
|
| 122 |
It means that the total demand must be less or equal to the |
|
| 123 | 123 |
total supply (i.e. \f$\sum_{u\in V} sup(u)\f$ must be zero or
|
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -420,3 +420,3 @@ |
| 420 | 420 |
_node_filter = &node_filter; |
| 421 |
_arc_filter = &arc_filter; |
|
| 421 |
_arc_filter = &arc_filter; |
|
| 422 | 422 |
} |
| ... | ... |
@@ -507,7 +507,7 @@ |
| 507 | 507 |
template <typename V> |
| 508 |
class NodeMap |
|
| 509 |
: public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, |
|
| 510 |
|
|
| 508 |
class NodeMap |
|
| 509 |
: public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, |
|
| 510 |
LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
|
|
| 511 | 511 |
typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, |
| 512 |
|
|
| 512 |
LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent; |
|
| 513 | 513 |
|
| ... | ... |
@@ -534,5 +534,5 @@ |
| 534 | 534 |
template <typename V> |
| 535 |
class ArcMap |
|
| 535 |
class ArcMap |
|
| 536 | 536 |
: public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, |
| 537 |
|
|
| 537 |
LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
|
|
| 538 | 538 |
typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, |
| ... | ... |
@@ -581,3 +581,3 @@ |
| 581 | 581 |
_node_filter = &node_filter; |
| 582 |
_arc_filter = &arc_filter; |
|
| 582 |
_arc_filter = &arc_filter; |
|
| 583 | 583 |
} |
| ... | ... |
@@ -650,6 +650,6 @@ |
| 650 | 650 |
template <typename V> |
| 651 |
class NodeMap |
|
| 651 |
class NodeMap |
|
| 652 | 652 |
: public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, |
| 653 | 653 |
LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
|
| 654 |
typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, |
|
| 654 |
typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, |
|
| 655 | 655 |
LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent; |
| ... | ... |
@@ -677,3 +677,3 @@ |
| 677 | 677 |
template <typename V> |
| 678 |
class ArcMap |
|
| 678 |
class ArcMap |
|
| 679 | 679 |
: public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, |
| ... | ... |
@@ -1018,6 +1018,6 @@ |
| 1018 | 1018 |
template <typename V> |
| 1019 |
class NodeMap |
|
| 1019 |
class NodeMap |
|
| 1020 | 1020 |
: public SubMapExtender<SubGraphBase<GR, NF, EF, ch>, |
| 1021 | 1021 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
|
| 1022 |
typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, |
|
| 1022 |
typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, |
|
| 1023 | 1023 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent; |
| ... | ... |
@@ -1045,6 +1045,6 @@ |
| 1045 | 1045 |
template <typename V> |
| 1046 |
class ArcMap |
|
| 1046 |
class ArcMap |
|
| 1047 | 1047 |
: public SubMapExtender<SubGraphBase<GR, NF, EF, ch>, |
| 1048 | 1048 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
|
| 1049 |
typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, |
|
| 1049 |
typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, |
|
| 1050 | 1050 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent; |
| ... | ... |
@@ -1072,6 +1072,6 @@ |
| 1072 | 1072 |
template <typename V> |
| 1073 |
class EdgeMap |
|
| 1073 |
class EdgeMap |
|
| 1074 | 1074 |
: public SubMapExtender<SubGraphBase<GR, NF, EF, ch>, |
| 1075 | 1075 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
|
| 1076 |
typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, |
|
| 1076 |
typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, |
|
| 1077 | 1077 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent; |
| ... | ... |
@@ -1114,4 +1114,4 @@ |
| 1114 | 1114 |
EF* _edge_filter; |
| 1115 |
SubGraphBase() |
|
| 1116 |
: Parent(), _node_filter(0), _edge_filter(0) { }
|
|
| 1115 |
SubGraphBase() |
|
| 1116 |
: Parent(), _node_filter(0), _edge_filter(0) { }
|
|
| 1117 | 1117 |
|
| ... | ... |
@@ -1216,6 +1216,6 @@ |
| 1216 | 1216 |
template <typename V> |
| 1217 |
class NodeMap |
|
| 1217 |
class NodeMap |
|
| 1218 | 1218 |
: public SubMapExtender<SubGraphBase<GR, NF, EF, false>, |
| 1219 | 1219 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
|
| 1220 |
typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, |
|
| 1220 |
typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, |
|
| 1221 | 1221 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent; |
| ... | ... |
@@ -1243,6 +1243,6 @@ |
| 1243 | 1243 |
template <typename V> |
| 1244 |
class ArcMap |
|
| 1244 |
class ArcMap |
|
| 1245 | 1245 |
: public SubMapExtender<SubGraphBase<GR, NF, EF, false>, |
| 1246 | 1246 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
|
| 1247 |
typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, |
|
| 1247 |
typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, |
|
| 1248 | 1248 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent; |
| ... | ... |
@@ -1270,7 +1270,7 @@ |
| 1270 | 1270 |
template <typename V> |
| 1271 |
class EdgeMap |
|
| 1271 |
class EdgeMap |
|
| 1272 | 1272 |
: public SubMapExtender<SubGraphBase<GR, NF, EF, false>, |
| 1273 | 1273 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
|
| 1274 |
typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, |
|
| 1275 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent; |
|
| 1274 |
typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, |
|
| 1275 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent; |
|
| 1276 | 1276 |
|
| ... | ... |
@@ -1497,3 +1497,3 @@ |
| 1497 | 1497 |
typedef DigraphAdaptorExtender< |
| 1498 |
SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >, |
|
| 1498 |
SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >, |
|
| 1499 | 1499 |
true> > Parent; |
| ... | ... |
@@ -1518,3 +1518,3 @@ |
| 1518 | 1518 |
/// given node filter map. |
| 1519 |
FilterNodes(GR& graph, NF& node_filter) |
|
| 1519 |
FilterNodes(GR& graph, NF& node_filter) |
|
| 1520 | 1520 |
: Parent(), const_true_map() |
| ... | ... |
@@ -1556,3 +1556,3 @@ |
| 1556 | 1556 |
public GraphAdaptorExtender< |
| 1557 |
SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, |
|
| 1557 |
SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, |
|
| 1558 | 1558 |
true> > {
|
| ... | ... |
@@ -1560,3 +1560,3 @@ |
| 1560 | 1560 |
typedef GraphAdaptorExtender< |
| 1561 |
SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, |
|
| 1561 |
SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, |
|
| 1562 | 1562 |
true> > Parent; |
| ... | ... |
@@ -1644,3 +1644,3 @@ |
| 1644 | 1644 |
typedef DigraphAdaptorExtender< |
| 1645 |
SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >, |
|
| 1645 |
SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >, |
|
| 1646 | 1646 |
AF, false> > Parent; |
| ... | ... |
@@ -1750,3 +1750,3 @@ |
| 1750 | 1750 |
public GraphAdaptorExtender< |
| 1751 |
SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true> >, |
|
| 1751 |
SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true> >, |
|
| 1752 | 1752 |
EF, false> > {
|
| ... | ... |
@@ -1754,3 +1754,3 @@ |
| 1754 | 1754 |
typedef GraphAdaptorExtender< |
| 1755 |
SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >, |
|
| 1755 |
SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >, |
|
| 1756 | 1756 |
EF, false> > Parent; |
| ... | ... |
@@ -1779,3 +1779,3 @@ |
| 1779 | 1779 |
/// filter map. |
| 1780 |
FilterEdges(GR& graph, EF& edge_filter) |
|
| 1780 |
FilterEdges(GR& graph, EF& edge_filter) |
|
| 1781 | 1781 |
: Parent(), const_true_map() {
|
| ... | ... |
@@ -1847,3 +1847,3 @@ |
| 1847 | 1847 |
|
| 1848 |
Arc(const Edge& edge, bool forward) |
|
| 1848 |
Arc(const Edge& edge, bool forward) |
|
| 1849 | 1849 |
: _edge(edge), _forward(forward) {}
|
| ... | ... |
@@ -2087,3 +2087,3 @@ |
| 2087 | 2087 |
ArcMapBase(const UndirectorBase<DGR>& adaptor, const V& value) |
| 2088 |
: _forward(*adaptor._digraph, value), |
|
| 2088 |
: _forward(*adaptor._digraph, value), |
|
| 2089 | 2089 |
_backward(*adaptor._digraph, value) {}
|
| ... | ... |
@@ -2205,3 +2205,3 @@ |
| 2205 | 2205 |
EdgeNotifier& notifier(Edge) const { return _digraph->notifier(Edge()); }
|
| 2206 |
|
|
| 2206 |
|
|
| 2207 | 2207 |
typedef EdgeNotifier ArcNotifier; |
| ... | ... |
@@ -2709,3 +2709,3 @@ |
| 2709 | 2709 |
typename TL = Tolerance<typename CM::Value> > |
| 2710 |
class ResidualDigraph |
|
| 2710 |
class ResidualDigraph |
|
| 2711 | 2711 |
: public SubDigraph< |
| ... | ... |
@@ -2766,3 +2766,3 @@ |
| 2766 | 2766 |
FM& flow, const TL& tolerance = Tolerance()) |
| 2767 |
: Parent(), _capacity(&capacity), _flow(&flow), |
|
| 2767 |
: Parent(), _capacity(&capacity), _flow(&flow), |
|
| 2768 | 2768 |
_graph(digraph), _node_filter(), |
| ... | ... |
@@ -2848,3 +2848,3 @@ |
| 2848 | 2848 |
/// Constructor |
| 2849 |
ResidualCapacity(const ResidualDigraph<DGR, CM, FM, TL>& adaptor) |
|
| 2849 |
ResidualCapacity(const ResidualDigraph<DGR, CM, FM, TL>& adaptor) |
|
| 2850 | 2850 |
: _adaptor(&adaptor) {}
|
| ... | ... |
@@ -3425,3 +3425,3 @@ |
| 3425 | 3425 |
/// Its value type is inherited from the first node map type (\c IN). |
| 3426 |
/// \tparam IN The type of the node map for the in-nodes. |
|
| 3426 |
/// \tparam IN The type of the node map for the in-nodes. |
|
| 3427 | 3427 |
/// \tparam OUT The type of the node map for the out-nodes. |
| 1 |
/* -*- C++ -*- |
|
| 1 |
/* -*- mode: C++; indent-tabs-mode: nil; -*- |
|
| 2 | 2 |
* |
| 3 |
* This file is a part of LEMON, a generic C++ optimization library |
|
| 3 |
* This file is a part of LEMON, a generic C++ optimization library. |
|
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -65,7 +65,7 @@ |
| 65 | 65 |
if (n == Parent::source(e)) |
| 66 |
|
|
| 66 |
return Parent::target(e); |
|
| 67 | 67 |
else if(n==Parent::target(e)) |
| 68 |
|
|
| 68 |
return Parent::source(e); |
|
| 69 | 69 |
else |
| 70 |
|
|
| 70 |
return INVALID; |
|
| 71 | 71 |
} |
| ... | ... |
@@ -93,3 +93,3 @@ |
| 93 | 93 |
|
| 94 |
class NodeIt : public Node {
|
|
| 94 |
class NodeIt : public Node {
|
|
| 95 | 95 |
const Digraph* digraph; |
| ... | ... |
@@ -102,11 +102,11 @@ |
| 102 | 102 |
explicit NodeIt(const Digraph& _graph) : digraph(&_graph) {
|
| 103 |
|
|
| 103 |
_graph.first(static_cast<Node&>(*this)); |
|
| 104 | 104 |
} |
| 105 | 105 |
|
| 106 |
NodeIt(const Digraph& _graph, const Node& node) |
|
| 107 |
: Node(node), digraph(&_graph) {}
|
|
| 106 |
NodeIt(const Digraph& _graph, const Node& node) |
|
| 107 |
: Node(node), digraph(&_graph) {}
|
|
| 108 | 108 |
|
| 109 |
NodeIt& operator++() {
|
|
| 110 |
digraph->next(*this); |
|
| 111 |
|
|
| 109 |
NodeIt& operator++() {
|
|
| 110 |
digraph->next(*this); |
|
| 111 |
return *this; |
|
| 112 | 112 |
} |
| ... | ... |
@@ -116,3 +116,3 @@ |
| 116 | 116 |
|
| 117 |
class ArcIt : public Arc {
|
|
| 117 |
class ArcIt : public Arc {
|
|
| 118 | 118 |
const Digraph* digraph; |
| ... | ... |
@@ -125,11 +125,11 @@ |
| 125 | 125 |
explicit ArcIt(const Digraph& _graph) : digraph(&_graph) {
|
| 126 |
|
|
| 126 |
_graph.first(static_cast<Arc&>(*this)); |
|
| 127 | 127 |
} |
| 128 | 128 |
|
| 129 |
ArcIt(const Digraph& _graph, const Arc& e) : |
|
| 130 |
Arc(e), digraph(&_graph) { }
|
|
| 129 |
ArcIt(const Digraph& _graph, const Arc& e) : |
|
| 130 |
Arc(e), digraph(&_graph) { }
|
|
| 131 | 131 |
|
| 132 |
ArcIt& operator++() {
|
|
| 133 |
digraph->next(*this); |
|
| 134 |
|
|
| 132 |
ArcIt& operator++() {
|
|
| 133 |
digraph->next(*this); |
|
| 134 |
return *this; |
|
| 135 | 135 |
} |
| ... | ... |
@@ -139,3 +139,3 @@ |
| 139 | 139 |
|
| 140 |
class OutArcIt : public Arc {
|
|
| 140 |
class OutArcIt : public Arc {
|
|
| 141 | 141 |
const Digraph* digraph; |
| ... | ... |
@@ -147,13 +147,13 @@ |
| 147 | 147 |
|
| 148 |
OutArcIt(const Digraph& _graph, const Node& node) |
|
| 149 |
: digraph(&_graph) {
|
|
| 150 |
|
|
| 148 |
OutArcIt(const Digraph& _graph, const Node& node) |
|
| 149 |
: digraph(&_graph) {
|
|
| 150 |
_graph.firstOut(*this, node); |
|
| 151 | 151 |
} |
| 152 | 152 |
|
| 153 |
OutArcIt(const Digraph& _graph, const Arc& arc) |
|
| 154 |
: Arc(arc), digraph(&_graph) {}
|
|
| 153 |
OutArcIt(const Digraph& _graph, const Arc& arc) |
|
| 154 |
: Arc(arc), digraph(&_graph) {}
|
|
| 155 | 155 |
|
| 156 |
OutArcIt& operator++() {
|
|
| 157 |
digraph->nextOut(*this); |
|
| 158 |
|
|
| 156 |
OutArcIt& operator++() {
|
|
| 157 |
digraph->nextOut(*this); |
|
| 158 |
return *this; |
|
| 159 | 159 |
} |
| ... | ... |
@@ -163,3 +163,3 @@ |
| 163 | 163 |
|
| 164 |
class InArcIt : public Arc {
|
|
| 164 |
class InArcIt : public Arc {
|
|
| 165 | 165 |
const Digraph* digraph; |
| ... | ... |
@@ -171,13 +171,13 @@ |
| 171 | 171 |
|
| 172 |
InArcIt(const Digraph& _graph, const Node& node) |
|
| 173 |
: digraph(&_graph) {
|
|
| 174 |
|
|
| 172 |
InArcIt(const Digraph& _graph, const Node& node) |
|
| 173 |
: digraph(&_graph) {
|
|
| 174 |
_graph.firstIn(*this, node); |
|
| 175 | 175 |
} |
| 176 | 176 |
|
| 177 |
InArcIt(const Digraph& _graph, const Arc& arc) : |
|
| 178 |
Arc(arc), digraph(&_graph) {}
|
|
| 177 |
InArcIt(const Digraph& _graph, const Arc& arc) : |
|
| 178 |
Arc(arc), digraph(&_graph) {}
|
|
| 179 | 179 |
|
| 180 |
InArcIt& operator++() {
|
|
| 181 |
digraph->nextIn(*this); |
|
| 182 |
|
|
| 180 |
InArcIt& operator++() {
|
|
| 181 |
digraph->nextIn(*this); |
|
| 182 |
return *this; |
|
| 183 | 183 |
} |
| ... | ... |
@@ -217,5 +217,5 @@ |
| 217 | 217 |
// Mappable extension |
| 218 |
|
|
| 218 |
|
|
| 219 | 219 |
template <typename _Value> |
| 220 |
class ArcMap |
|
| 220 |
class ArcMap |
|
| 221 | 221 |
: public MapExtender<DefaultMap<Digraph, Arc, _Value> > {
|
| ... | ... |
@@ -224,9 +224,9 @@ |
| 224 | 224 |
public: |
| 225 |
explicit ArcMap(const Digraph& _g) |
|
| 226 |
: Parent(_g) {}
|
|
| 227 |
ArcMap(const Digraph& _g, const _Value& _v) |
|
| 228 |
: Parent(_g, _v) {}
|
|
| 225 |
explicit ArcMap(const Digraph& _g) |
|
| 226 |
: Parent(_g) {}
|
|
| 227 |
ArcMap(const Digraph& _g, const _Value& _v) |
|
| 228 |
: Parent(_g, _v) {}
|
|
| 229 | 229 |
|
| 230 | 230 |
ArcMap& operator=(const ArcMap& cmap) {
|
| 231 |
|
|
| 231 |
return operator=<ArcMap>(cmap); |
|
| 232 | 232 |
} |
| ... | ... |
@@ -236,3 +236,3 @@ |
| 236 | 236 |
Parent::operator=(cmap); |
| 237 |
|
|
| 237 |
return *this; |
|
| 238 | 238 |
} |
| ... | ... |
@@ -249,3 +249,3 @@ |
| 249 | 249 |
} |
| 250 |
|
|
| 250 |
|
|
| 251 | 251 |
void clear() {
|
| ... | ... |
@@ -314,7 +314,7 @@ |
| 314 | 314 |
if( n == Parent::u(e)) |
| 315 |
|
|
| 315 |
return Parent::v(e); |
|
| 316 | 316 |
else if( n == Parent::v(e)) |
| 317 |
|
|
| 317 |
return Parent::u(e); |
|
| 318 | 318 |
else |
| 319 |
|
|
| 319 |
return INVALID; |
|
| 320 | 320 |
} |
| ... | ... |
@@ -342,3 +342,3 @@ |
| 342 | 342 |
using Parent::notifier; |
| 343 |
|
|
| 343 |
|
|
| 344 | 344 |
ArcNotifier& notifier(Arc) const {
|
| ... | ... |
@@ -352,3 +352,3 @@ |
| 352 | 352 |
|
| 353 |
class NodeIt : public Node {
|
|
| 353 |
class NodeIt : public Node {
|
|
| 354 | 354 |
const Graph* graph; |
| ... | ... |
@@ -361,11 +361,11 @@ |
| 361 | 361 |
explicit NodeIt(const Graph& _graph) : graph(&_graph) {
|
| 362 |
|
|
| 362 |
_graph.first(static_cast<Node&>(*this)); |
|
| 363 | 363 |
} |
| 364 | 364 |
|
| 365 |
NodeIt(const Graph& _graph, const Node& node) |
|
| 366 |
: Node(node), graph(&_graph) {}
|
|
| 365 |
NodeIt(const Graph& _graph, const Node& node) |
|
| 366 |
: Node(node), graph(&_graph) {}
|
|
| 367 | 367 |
|
| 368 |
NodeIt& operator++() {
|
|
| 369 |
graph->next(*this); |
|
| 370 |
|
|
| 368 |
NodeIt& operator++() {
|
|
| 369 |
graph->next(*this); |
|
| 370 |
return *this; |
|
| 371 | 371 |
} |
| ... | ... |
@@ -375,3 +375,3 @@ |
| 375 | 375 |
|
| 376 |
class ArcIt : public Arc {
|
|
| 376 |
class ArcIt : public Arc {
|
|
| 377 | 377 |
const Graph* graph; |
| ... | ... |
@@ -384,11 +384,11 @@ |
| 384 | 384 |
explicit ArcIt(const Graph& _graph) : graph(&_graph) {
|
| 385 |
|
|
| 385 |
_graph.first(static_cast<Arc&>(*this)); |
|
| 386 | 386 |
} |
| 387 | 387 |
|
| 388 |
ArcIt(const Graph& _graph, const Arc& e) : |
|
| 389 |
Arc(e), graph(&_graph) { }
|
|
| 388 |
ArcIt(const Graph& _graph, const Arc& e) : |
|
| 389 |
Arc(e), graph(&_graph) { }
|
|
| 390 | 390 |
|
| 391 |
ArcIt& operator++() {
|
|
| 392 |
graph->next(*this); |
|
| 393 |
|
|
| 391 |
ArcIt& operator++() {
|
|
| 392 |
graph->next(*this); |
|
| 393 |
return *this; |
|
| 394 | 394 |
} |
| ... | ... |
@@ -398,3 +398,3 @@ |
| 398 | 398 |
|
| 399 |
class OutArcIt : public Arc {
|
|
| 399 |
class OutArcIt : public Arc {
|
|
| 400 | 400 |
const Graph* graph; |
| ... | ... |
@@ -406,13 +406,13 @@ |
| 406 | 406 |
|
| 407 |
OutArcIt(const Graph& _graph, const Node& node) |
|
| 408 |
: graph(&_graph) {
|
|
| 409 |
|
|
| 407 |
OutArcIt(const Graph& _graph, const Node& node) |
|
| 408 |
: graph(&_graph) {
|
|
| 409 |
_graph.firstOut(*this, node); |
|
| 410 | 410 |
} |
| 411 | 411 |
|
| 412 |
OutArcIt(const Graph& _graph, const Arc& arc) |
|
| 413 |
: Arc(arc), graph(&_graph) {}
|
|
| 412 |
OutArcIt(const Graph& _graph, const Arc& arc) |
|
| 413 |
: Arc(arc), graph(&_graph) {}
|
|
| 414 | 414 |
|
| 415 |
OutArcIt& operator++() {
|
|
| 416 |
graph->nextOut(*this); |
|
| 417 |
|
|
| 415 |
OutArcIt& operator++() {
|
|
| 416 |
graph->nextOut(*this); |
|
| 417 |
return *this; |
|
| 418 | 418 |
} |
| ... | ... |
@@ -422,3 +422,3 @@ |
| 422 | 422 |
|
| 423 |
class InArcIt : public Arc {
|
|
| 423 |
class InArcIt : public Arc {
|
|
| 424 | 424 |
const Graph* graph; |
| ... | ... |
@@ -430,13 +430,13 @@ |
| 430 | 430 |
|
| 431 |
InArcIt(const Graph& _graph, const Node& node) |
|
| 432 |
: graph(&_graph) {
|
|
| 433 |
|
|
| 431 |
InArcIt(const Graph& _graph, const Node& node) |
|
| 432 |
: graph(&_graph) {
|
|
| 433 |
_graph.firstIn(*this, node); |
|
| 434 | 434 |
} |
| 435 | 435 |
|
| 436 |
InArcIt(const Graph& _graph, const Arc& arc) : |
|
| 437 |
Arc(arc), graph(&_graph) {}
|
|
| 436 |
InArcIt(const Graph& _graph, const Arc& arc) : |
|
| 437 |
Arc(arc), graph(&_graph) {}
|
|
| 438 | 438 |
|
| 439 |
InArcIt& operator++() {
|
|
| 440 |
graph->nextIn(*this); |
|
| 441 |
|
|
| 439 |
InArcIt& operator++() {
|
|
| 440 |
graph->nextIn(*this); |
|
| 441 |
return *this; |
|
| 442 | 442 |
} |
| ... | ... |
@@ -446,3 +446,3 @@ |
| 446 | 446 |
|
| 447 |
class EdgeIt : public Parent::Edge {
|
|
| 447 |
class EdgeIt : public Parent::Edge {
|
|
| 448 | 448 |
const Graph* graph; |
| ... | ... |
@@ -455,11 +455,11 @@ |
| 455 | 455 |
explicit EdgeIt(const Graph& _graph) : graph(&_graph) {
|
| 456 |
|
|
| 456 |
_graph.first(static_cast<Edge&>(*this)); |
|
| 457 | 457 |
} |
| 458 | 458 |
|
| 459 |
EdgeIt(const Graph& _graph, const Edge& e) : |
|
| 460 |
Edge(e), graph(&_graph) { }
|
|
| 459 |
EdgeIt(const Graph& _graph, const Edge& e) : |
|
| 460 |
Edge(e), graph(&_graph) { }
|
|
| 461 | 461 |
|
| 462 |
EdgeIt& operator++() {
|
|
| 463 |
graph->next(*this); |
|
| 464 |
|
|
| 462 |
EdgeIt& operator++() {
|
|
| 463 |
graph->next(*this); |
|
| 464 |
return *this; |
|
| 465 | 465 |
} |
| ... | ... |
@@ -479,3 +479,3 @@ |
| 479 | 479 |
IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) {
|
| 480 |
|
|
| 480 |
_graph.firstInc(*this, direction, n); |
|
| 481 | 481 |
} |
| ... | ... |
@@ -483,4 +483,4 @@ |
| 483 | 483 |
IncEdgeIt(const Graph& _graph, const Edge &ue, const Node &n) |
| 484 |
: graph(&_graph), Edge(ue) {
|
|
| 485 |
direction = (_graph.source(ue) == n); |
|
| 484 |
: graph(&_graph), Edge(ue) {
|
|
| 485 |
direction = (_graph.source(ue) == n); |
|
| 486 | 486 |
} |
| ... | ... |
@@ -488,4 +488,4 @@ |
| 488 | 488 |
IncEdgeIt& operator++() {
|
| 489 |
graph->nextInc(*this, direction); |
|
| 490 |
return *this; |
|
| 489 |
graph->nextInc(*this, direction); |
|
| 490 |
return *this; |
|
| 491 | 491 |
} |
| ... | ... |
@@ -536,3 +536,3 @@ |
| 536 | 536 |
template <typename _Value> |
| 537 |
class ArcMap |
|
| 537 |
class ArcMap |
|
| 538 | 538 |
: public MapExtender<DefaultMap<Graph, Arc, _Value> > {
|
| ... | ... |
@@ -541,9 +541,9 @@ |
| 541 | 541 |
public: |
| 542 |
explicit ArcMap(const Graph& _g) |
|
| 543 |
: Parent(_g) {}
|
|
| 544 |
ArcMap(const Graph& _g, const _Value& _v) |
|
| 545 |
: Parent(_g, _v) {}
|
|
| 542 |
explicit ArcMap(const Graph& _g) |
|
| 543 |
: Parent(_g) {}
|
|
| 544 |
ArcMap(const Graph& _g, const _Value& _v) |
|
| 545 |
: Parent(_g, _v) {}
|
|
| 546 | 546 |
|
| 547 | 547 |
ArcMap& operator=(const ArcMap& cmap) {
|
| 548 |
|
|
| 548 |
return operator=<ArcMap>(cmap); |
|
| 549 | 549 |
} |
| ... | ... |
@@ -553,3 +553,3 @@ |
| 553 | 553 |
Parent::operator=(cmap); |
| 554 |
|
|
| 554 |
return *this; |
|
| 555 | 555 |
} |
| ... | ... |
@@ -560,3 +560,3 @@ |
| 560 | 560 |
template <typename _Value> |
| 561 |
class EdgeMap |
|
| 561 |
class EdgeMap |
|
| 562 | 562 |
: public MapExtender<DefaultMap<Graph, Edge, _Value> > {
|
| ... | ... |
@@ -565,10 +565,10 @@ |
| 565 | 565 |
public: |
| 566 |
explicit EdgeMap(const Graph& _g) |
|
| 567 |
: Parent(_g) {}
|
|
| 566 |
explicit EdgeMap(const Graph& _g) |
|
| 567 |
: Parent(_g) {}
|
|
| 568 | 568 |
|
| 569 |
EdgeMap(const Graph& _g, const _Value& _v) |
|
| 570 |
: Parent(_g, _v) {}
|
|
| 569 |
EdgeMap(const Graph& _g, const _Value& _v) |
|
| 570 |
: Parent(_g, _v) {}
|
|
| 571 | 571 |
|
| 572 | 572 |
EdgeMap& operator=(const EdgeMap& cmap) {
|
| 573 |
|
|
| 573 |
return operator=<EdgeMap>(cmap); |
|
| 574 | 574 |
} |
| ... | ... |
@@ -578,3 +578,3 @@ |
| 578 | 578 |
Parent::operator=(cmap); |
| 579 |
|
|
| 579 |
return *this; |
|
| 580 | 580 |
} |
| ... | ... |
@@ -595,3 +595,3 @@ |
| 595 | 595 |
} |
| 596 |
|
|
| 596 |
|
|
| 597 | 597 |
void clear() {
|
| ... | ... |
@@ -621,3 +621,3 @@ |
| 621 | 621 |
} |
| 622 |
|
|
| 622 |
|
|
| 623 | 623 |
}; |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -100,3 +100,3 @@ |
| 100 | 100 |
char buf1[11], buf2[9], buf3[5]; |
| 101 |
|
|
| 101 |
if (GetDateFormat(MY_LOCALE, 0, &time, |
|
| 102 | 102 |
("ddd MMM dd"), buf1, 11) &&
|
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -61,4 +61,4 @@ |
| 61 | 61 |
/// |
| 62 |
/// The type of the map that stores the signed supply values of the |
|
| 63 |
/// nodes. |
|
| 62 |
/// The type of the map that stores the signed supply values of the |
|
| 63 |
/// nodes. |
|
| 64 | 64 |
/// It must conform to the \ref concepts::ReadMap "ReadMap" concept. |
| ... | ... |
@@ -136,3 +136,3 @@ |
| 136 | 136 |
\f[ lower(uv) \leq f(uv) \leq upper(uv) \quad \forall uv\in A. \f] |
| 137 |
|
|
| 137 |
|
|
| 138 | 138 |
The sum of the supply values, i.e. \f$\sum_{u\in V} sup(u)\f$ must be
|
| ... | ... |
@@ -146,3 +146,3 @@ |
| 146 | 146 |
have to be satisfied and all supplies have to be used. |
| 147 |
|
|
| 147 |
|
|
| 148 | 148 |
If you need the opposite inequalities in the supply/demand constraints |
| ... | ... |
@@ -327,3 +327,3 @@ |
| 327 | 327 |
/// \param lower The lower bounds for the flow values on the arcs. |
| 328 |
/// \param upper The upper bounds (capacities) for the flow values |
|
| 328 |
/// \param upper The upper bounds (capacities) for the flow values |
|
| 329 | 329 |
/// on the arcs. |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -437,3 +437,3 @@ |
| 437 | 437 |
///Copy constructor |
| 438 |
NodeMap(const NodeMap& nm) : |
|
| 438 |
NodeMap(const NodeMap& nm) : |
|
| 439 | 439 |
ReferenceMap<Node, T, T&, const T&>(nm) { }
|
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -40,3 +40,3 @@ |
| 40 | 40 |
/// create graph skeleton classes. The reason for this is that \c Node |
| 41 |
/// and \c Arc (or \c Edge) types should \e not derive from the same |
|
| 41 |
/// and \c Arc (or \c Edge) types should \e not derive from the same |
|
| 42 | 42 |
/// base class. For \c Node you should instantiate it with character |
| ... | ... |
@@ -91,3 +91,3 @@ |
| 91 | 91 |
/// This operator defines an ordering of the items. |
| 92 |
/// It makes possible to use graph item types as key types in |
|
| 92 |
/// It makes possible to use graph item types as key types in |
|
| 93 | 93 |
/// associative containers (e.g. \c std::map). |
| ... | ... |
@@ -124,3 +124,3 @@ |
| 124 | 124 |
/// All digraph %concepts have to conform to this class. |
| 125 |
/// It just provides types for nodes and arcs and functions |
|
| 125 |
/// It just provides types for nodes and arcs and functions |
|
| 126 | 126 |
/// to get the source and the target nodes of arcs. |
| ... | ... |
@@ -428,3 +428,3 @@ |
| 428 | 428 |
/// |
| 429 |
/// This class describes the concept of \c NodeIt, \c ArcIt and |
|
| 429 |
/// This class describes the concept of \c NodeIt, \c ArcIt and |
|
| 430 | 430 |
/// \c EdgeIt subtypes of digraph and graph types. |
| ... | ... |
@@ -468,3 +468,3 @@ |
| 468 | 468 |
GraphItemIt& operator++() { return *this; }
|
| 469 |
|
|
| 469 |
|
|
| 470 | 470 |
/// \brief Equality operator |
| ... | ... |
@@ -503,6 +503,6 @@ |
| 503 | 503 |
|
| 504 |
/// \brief Concept class for \c InArcIt, \c OutArcIt and |
|
| 504 |
/// \brief Concept class for \c InArcIt, \c OutArcIt and |
|
| 505 | 505 |
/// \c IncEdgeIt types. |
| 506 | 506 |
/// |
| 507 |
/// This class describes the concept of \c InArcIt, \c OutArcIt |
|
| 507 |
/// This class describes the concept of \c InArcIt, \c OutArcIt |
|
| 508 | 508 |
/// and \c IncEdgeIt subtypes of digraph and graph types. |
| ... | ... |
@@ -511,3 +511,3 @@ |
| 511 | 511 |
/// base class, there is an additional template parameter (selector) |
| 512 |
/// \c sel. For \c InArcIt you should instantiate it with character |
|
| 512 |
/// \c sel. For \c InArcIt you should instantiate it with character |
|
| 513 | 513 |
/// \c 'i', for \c OutArcIt with \c 'o' and for \c IncEdgeIt with \c 'e'. |
| ... | ... |
@@ -532,6 +532,6 @@ |
| 532 | 532 |
|
| 533 |
/// \brief Constructor that sets the iterator to the first |
|
| 533 |
/// \brief Constructor that sets the iterator to the first |
|
| 534 | 534 |
/// incoming or outgoing arc. |
| 535 | 535 |
/// |
| 536 |
/// Constructor that sets the iterator to the first arc |
|
| 536 |
/// Constructor that sets the iterator to the first arc |
|
| 537 | 537 |
/// incoming to or outgoing from the given node. |
| ... | ... |
@@ -806,5 +806,5 @@ |
| 806 | 806 |
/// |
| 807 |
/// This function gives back the first edge incident to the given |
|
| 807 |
/// This function gives back the first edge incident to the given |
|
| 808 | 808 |
/// node. The bool parameter gives back the direction for which the |
| 809 |
/// source node of the directed arc representing the edge is the |
|
| 809 |
/// source node of the directed arc representing the edge is the |
|
| 810 | 810 |
/// given node. |
| ... | ... |
@@ -815,3 +815,3 @@ |
| 815 | 815 |
/// |
| 816 |
/// This function gives back the next edge incident to the given |
|
| 816 |
/// This function gives back the next edge incident to the given |
|
| 817 | 817 |
/// node. The bool parameter should be used as \c firstInc() use it. |
| ... | ... |
@@ -992,3 +992,3 @@ |
| 992 | 992 |
/// This class describes the concept of standard graph maps, i.e. |
| 993 |
/// the \c NodeMap, \c ArcMap and \c EdgeMap subtypes of digraph and |
|
| 993 |
/// the \c NodeMap, \c ArcMap and \c EdgeMap subtypes of digraph and |
|
| 994 | 994 |
/// graph types, which can be used for associating data to graph items. |
| ... | ... |
@@ -1047,3 +1047,3 @@ |
| 1047 | 1047 |
_Map m2(g,t); |
| 1048 |
|
|
| 1048 |
|
|
| 1049 | 1049 |
// Copy constructor |
| ... | ... |
@@ -1070,3 +1070,3 @@ |
| 1070 | 1070 |
/// This class describes the interface of mappable directed graphs. |
| 1071 |
/// It extends \ref BaseDigraphComponent with the standard digraph |
|
| 1071 |
/// It extends \ref BaseDigraphComponent with the standard digraph |
|
| 1072 | 1072 |
/// map classes, namely \c NodeMap and \c ArcMap. |
| ... | ... |
@@ -1207,3 +1207,3 @@ |
| 1207 | 1207 |
/// This class describes the interface of mappable undirected graphs. |
| 1208 |
/// It extends \ref MappableDigraphComponent with the standard graph |
|
| 1208 |
/// It extends \ref MappableDigraphComponent with the standard graph |
|
| 1209 | 1209 |
/// map class for edges (\c EdgeMap). |
| ... | ... |
@@ -1292,3 +1292,3 @@ |
| 1292 | 1292 |
/// This class describes the interface of extendable directed graphs. |
| 1293 |
/// It extends \ref BaseDigraphComponent with functions for adding |
|
| 1293 |
/// It extends \ref BaseDigraphComponent with functions for adding |
|
| 1294 | 1294 |
/// nodes and arcs to the digraph. |
| ... | ... |
@@ -1336,3 +1336,3 @@ |
| 1336 | 1336 |
/// This class describes the interface of extendable undirected graphs. |
| 1337 |
/// It extends \ref BaseGraphComponent with functions for adding |
|
| 1337 |
/// It extends \ref BaseGraphComponent with functions for adding |
|
| 1338 | 1338 |
/// nodes and edges to the graph. |
| ... | ... |
@@ -1380,3 +1380,3 @@ |
| 1380 | 1380 |
/// This class describes the interface of erasable directed graphs. |
| 1381 |
/// It extends \ref BaseDigraphComponent with functions for removing |
|
| 1381 |
/// It extends \ref BaseDigraphComponent with functions for removing |
|
| 1382 | 1382 |
/// nodes and arcs from the digraph. |
| ... | ... |
@@ -1393,3 +1393,3 @@ |
| 1393 | 1393 |
/// |
| 1394 |
/// This function erases the given node from the digraph and all arcs |
|
| 1394 |
/// This function erases the given node from the digraph and all arcs |
|
| 1395 | 1395 |
/// connected to the node. |
| ... | ... |
@@ -1419,3 +1419,3 @@ |
| 1419 | 1419 |
/// This class describes the interface of erasable undirected graphs. |
| 1420 |
/// It extends \ref BaseGraphComponent with functions for removing |
|
| 1420 |
/// It extends \ref BaseGraphComponent with functions for removing |
|
| 1421 | 1421 |
/// nodes and edges from the graph. |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -260,3 +260,3 @@ |
| 260 | 260 |
/// \note By definition, the empty digraph is strongly connected. |
| 261 |
/// |
|
| 261 |
/// |
|
| 262 | 262 |
/// \see countStronglyConnectedComponents(), stronglyConnectedComponents() |
| ... | ... |
@@ -312,3 +312,3 @@ |
| 312 | 312 |
/// |
| 313 |
/// \brief Count the number of strongly connected components of a |
|
| 313 |
/// \brief Count the number of strongly connected components of a |
|
| 314 | 314 |
/// directed graph |
| ... | ... |
@@ -746,3 +746,3 @@ |
| 746 | 746 |
/// |
| 747 |
/// This function checks whether the given undirected graph is |
|
| 747 |
/// This function checks whether the given undirected graph is |
|
| 748 | 748 |
/// bi-node-connected, i.e. any two edges are on same circle. |
| ... | ... |
@@ -760,3 +760,3 @@ |
| 760 | 760 |
/// |
| 761 |
/// \brief Count the number of bi-node-connected components of an |
|
| 761 |
/// \brief Count the number of bi-node-connected components of an |
|
| 762 | 762 |
/// undirected graph. |
| ... | ... |
@@ -814,3 +814,3 @@ |
| 814 | 814 |
/// to the number of the bi-node-connected components minus one. Each |
| 815 |
/// value of the map will be set exactly once, and the values of a |
|
| 815 |
/// value of the map will be set exactly once, and the values of a |
|
| 816 | 816 |
/// certain component will be set continuously. |
| ... | ... |
@@ -860,3 +860,3 @@ |
| 860 | 860 |
/// \param graph The undirected graph. |
| 861 |
/// \retval cutMap A writable node map. The values will be set to |
|
| 861 |
/// \retval cutMap A writable node map. The values will be set to |
|
| 862 | 862 |
/// \c true for the nodes that separate two or more components |
| ... | ... |
@@ -1087,3 +1087,3 @@ |
| 1087 | 1087 |
/// |
| 1088 |
/// This function checks whether the given undirected graph is |
|
| 1088 |
/// This function checks whether the given undirected graph is |
|
| 1089 | 1089 |
/// bi-edge-connected, i.e. any two nodes are connected with at least |
| ... | ... |
@@ -1194,3 +1194,3 @@ |
| 1194 | 1194 |
/// This function finds the bi-edge-connected cut edges in the given |
| 1195 |
/// undirected graph. |
|
| 1195 |
/// undirected graph. |
|
| 1196 | 1196 |
/// |
| ... | ... |
@@ -1351,3 +1351,3 @@ |
| 1351 | 1351 |
/// \retval order A readable and writable node map. The values will be |
| 1352 |
/// set from 0 to the number of the nodes in the digraph minus one. |
|
| 1352 |
/// set from 0 to the number of the nodes in the digraph minus one. |
|
| 1353 | 1353 |
/// Each value of the map will be set exactly once, and the values will |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -1243,3 +1243,4 @@ |
| 1243 | 1243 |
|
| 1244 |
class AutoNodeMap : |
|
| 1244 |
class AutoNodeMap : |
|
| 1245 |
public ItemSetTraits<GR, Node>::template Map<Arc>::Type {
|
|
| 1245 | 1246 |
typedef typename ItemSetTraits<GR, Node>::template Map<Arc>::Type Parent; |
| ... | ... |
@@ -1282,3 +1283,3 @@ |
| 1282 | 1283 |
|
| 1283 |
protected: |
|
| 1284 |
protected: |
|
| 1284 | 1285 |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -458,3 +458,3 @@ |
| 458 | 458 |
void CplexBase::_applyMessageLevel() {
|
| 459 |
CPXsetintparam(cplexEnv(), CPX_PARAM_SCRIND, |
|
| 459 |
CPXsetintparam(cplexEnv(), CPX_PARAM_SCRIND, |
|
| 460 | 460 |
_message_enabled ? CPX_ON : CPX_OFF); |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -63,3 +63,3 @@ |
| 63 | 63 |
///This function starts seeking the beginning of the given file for the |
| 64 |
///problem type and size info. |
|
| 64 |
///problem type and size info. |
|
| 65 | 65 |
///The found data is returned in a special struct that can be evaluated |
| ... | ... |
@@ -214,3 +214,3 @@ |
| 214 | 214 |
std::numeric_limits<Capacity>::max(); |
| 215 |
|
|
| 215 |
|
|
| 216 | 216 |
while (is >> c) {
|
| ... | ... |
@@ -239,3 +239,3 @@ |
| 239 | 239 |
capacity.set(e, _cap); |
| 240 |
} |
|
| 240 |
} |
|
| 241 | 241 |
else if (desc.type==DimacsDescriptor::MAX) {
|
| ... | ... |
@@ -364,3 +364,3 @@ |
| 364 | 364 |
} |
| 365 |
|
|
| 365 |
|
|
| 366 | 366 |
/// \brief DIMACS plain (di)graph reader function. |
| ... | ... |
@@ -368,3 +368,3 @@ |
| 368 | 368 |
/// This function reads a plain (di)graph without any designated nodes |
| 369 |
/// and maps (e.g. a matching instance) from DIMACS format, i.e. from |
|
| 369 |
/// and maps (e.g. a matching instance) from DIMACS format, i.e. from |
|
| 370 | 370 |
/// DIMACS files having a line starting with |
| ... | ... |
@@ -394,3 +394,3 @@ |
| 394 | 394 |
} |
| 395 |
|
|
| 395 |
|
|
| 396 | 396 |
while (is >> c) {
|
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -28,3 +28,3 @@ |
| 28 | 28 |
/// \file |
| 29 |
/// \brief Euler tour iterators and a function for checking the \e Eulerian |
|
| 29 |
/// \brief Euler tour iterators and a function for checking the \e Eulerian |
|
| 30 | 30 |
/// property. |
| ... | ... |
@@ -43,3 +43,3 @@ |
| 43 | 43 |
///For example, if the given digraph has an Euler tour (i.e it has only one |
| 44 |
///non-trivial component and the in-degree is equal to the out-degree |
|
| 44 |
///non-trivial component and the in-degree is equal to the out-degree |
|
| 45 | 45 |
///for all nodes), then the following code will put the arcs of \c g |
| ... | ... |
@@ -140,3 +140,3 @@ |
| 140 | 140 |
/// |
| 141 |
///For example, if the given graph has an Euler tour (i.e it has only one |
|
| 141 |
///For example, if the given graph has an Euler tour (i.e it has only one |
|
| 142 | 142 |
///non-trivial component and the degree of each node is even), |
| ... | ... |
@@ -149,3 +149,3 @@ |
| 149 | 149 |
///\endcode |
| 150 |
///Although this iterator is for undirected graphs, it still returns |
|
| 150 |
///Although this iterator is for undirected graphs, it still returns |
|
| 151 | 151 |
///arcs in order to indicate the direction of the tour. |
| ... | ... |
@@ -235,3 +235,3 @@ |
| 235 | 235 |
/// |
| 236 |
///\warning This incrementation returns an \c Arc (which converts to |
|
| 236 |
///\warning This incrementation returns an \c Arc (which converts to |
|
| 237 | 237 |
///an \c Edge), not an \ref EulerIt, as one may expect. |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -32,3 +32,3 @@ |
| 32 | 32 |
private: |
| 33 |
void *_ptr; |
|
| 33 |
void *_ptr; |
|
| 34 | 34 |
public: |
| ... | ... |
@@ -40,4 +40,4 @@ |
| 40 | 40 |
template <typename T> |
| 41 |
VoidPtr& operator=(T* ptr) {
|
|
| 42 |
_ptr = reinterpret_cast<void*>(ptr); |
|
| 41 |
VoidPtr& operator=(T* ptr) {
|
|
| 42 |
_ptr = reinterpret_cast<void*>(ptr); |
|
| 43 | 43 |
return *this; |
| ... | ... |
@@ -125,3 +125,3 @@ |
| 125 | 125 |
}; |
| 126 |
|
|
| 126 |
|
|
| 127 | 127 |
static FreeEnvHelper freeEnvHelper; |
| ... | ... |
@@ -129,5 +129,5 @@ |
| 129 | 129 |
protected: |
| 130 |
|
|
| 130 |
|
|
| 131 | 131 |
int _message_level; |
| 132 |
|
|
| 132 |
|
|
| 133 | 133 |
public: |
| 1 |
/* -*- C++ -*- |
|
| 1 |
/* -*- mode: C++; indent-tabs-mode: nil; -*- |
|
| 2 | 2 |
* |
| 3 |
* This file is a part of LEMON, a generic C++ optimization library |
|
| 3 |
* This file is a part of LEMON, a generic C++ optimization library. |
|
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -29,3 +29,3 @@ |
| 29 | 29 |
/// \ingroup min_cut |
| 30 |
/// \file |
|
| 30 |
/// \file |
|
| 31 | 31 |
/// \brief Gomory-Hu cut tree in graphs. |
| ... | ... |
@@ -40,3 +40,3 @@ |
| 40 | 40 |
/// may contain edges which are not in the original graph. It has the |
| 41 |
/// property that the minimum capacity edge of the path between two nodes |
|
| 41 |
/// property that the minimum capacity edge of the path between two nodes |
|
| 42 | 42 |
/// in this tree has the same weight as the minimum cut in the graph |
| ... | ... |
@@ -46,3 +46,3 @@ |
| 46 | 46 |
/// of nodes can easily be obtained. |
| 47 |
/// |
|
| 47 |
/// |
|
| 48 | 48 |
/// The algorithm calculates \e n-1 distinct minimum cuts (currently with |
| ... | ... |
@@ -62,6 +62,6 @@ |
| 62 | 62 |
template <typename GR, |
| 63 |
|
|
| 63 |
typename CAP> |
|
| 64 | 64 |
#else |
| 65 | 65 |
template <typename GR, |
| 66 |
|
|
| 66 |
typename CAP = typename GR::template EdgeMap<int> > |
|
| 67 | 67 |
#endif |
| ... | ... |
@@ -76,3 +76,3 @@ |
| 76 | 76 |
typedef typename Capacity::Value Value; |
| 77 |
|
|
| 77 |
|
|
| 78 | 78 |
private: |
| ... | ... |
@@ -91,9 +91,9 @@ |
| 91 | 91 |
if (!_pred) {
|
| 92 |
|
|
| 92 |
_pred = new typename Graph::template NodeMap<Node>(_graph); |
|
| 93 | 93 |
} |
| 94 | 94 |
if (!_weight) {
|
| 95 |
|
|
| 95 |
_weight = new typename Graph::template NodeMap<Value>(_graph); |
|
| 96 | 96 |
} |
| 97 | 97 |
if (!_order) {
|
| 98 |
|
|
| 98 |
_order = new typename Graph::template NodeMap<int>(_graph); |
|
| 99 | 99 |
} |
| ... | ... |
@@ -103,12 +103,12 @@ |
| 103 | 103 |
if (_pred) {
|
| 104 |
|
|
| 104 |
delete _pred; |
|
| 105 | 105 |
} |
| 106 | 106 |
if (_weight) {
|
| 107 |
|
|
| 107 |
delete _weight; |
|
| 108 | 108 |
} |
| 109 | 109 |
if (_order) {
|
| 110 |
|
|
| 110 |
delete _order; |
|
| 111 | 111 |
} |
| 112 | 112 |
} |
| 113 |
|
|
| 113 |
|
|
| 114 | 114 |
public: |
| ... | ... |
@@ -120,5 +120,5 @@ |
| 120 | 120 |
/// \param capacity The edge capacity map. |
| 121 |
GomoryHu(const Graph& graph, const Capacity& capacity) |
|
| 121 |
GomoryHu(const Graph& graph, const Capacity& capacity) |
|
| 122 | 122 |
: _graph(graph), _capacity(capacity), |
| 123 |
|
|
| 123 |
_pred(0), _weight(0), _order(0) |
|
| 124 | 124 |
{
|
| ... | ... |
@@ -136,3 +136,3 @@ |
| 136 | 136 |
private: |
| 137 |
|
|
| 137 |
|
|
| 138 | 138 |
// Initialize the internal data structures |
| ... | ... |
@@ -147,3 +147,3 @@ |
| 147 | 147 |
(*_pred)[_root] = INVALID; |
| 148 |
(*_weight)[_root] = std::numeric_limits<Value>::max(); |
|
| 148 |
(*_weight)[_root] = std::numeric_limits<Value>::max(); |
|
| 149 | 149 |
} |
| ... | ... |
@@ -156,23 +156,23 @@ |
| 156 | 156 |
for (NodeIt n(_graph); n != INVALID; ++n) {
|
| 157 |
|
|
| 157 |
if (n == _root) continue; |
|
| 158 | 158 |
|
| 159 |
Node pn = (*_pred)[n]; |
|
| 160 |
fa.source(n); |
|
| 161 |
|
|
| 159 |
Node pn = (*_pred)[n]; |
|
| 160 |
fa.source(n); |
|
| 161 |
fa.target(pn); |
|
| 162 | 162 |
|
| 163 |
|
|
| 163 |
fa.runMinCut(); |
|
| 164 | 164 |
|
| 165 |
|
|
| 165 |
(*_weight)[n] = fa.flowValue(); |
|
| 166 | 166 |
|
| 167 |
for (NodeIt nn(_graph); nn != INVALID; ++nn) {
|
|
| 168 |
if (nn != n && fa.minCut(nn) && (*_pred)[nn] == pn) {
|
|
| 169 |
(*_pred)[nn] = n; |
|
| 170 |
} |
|
| 171 |
} |
|
| 172 |
if ((*_pred)[pn] != INVALID && fa.minCut((*_pred)[pn])) {
|
|
| 173 |
(*_pred)[n] = (*_pred)[pn]; |
|
| 174 |
(*_pred)[pn] = n; |
|
| 175 |
(*_weight)[n] = (*_weight)[pn]; |
|
| 176 |
(*_weight)[pn] = fa.flowValue(); |
|
| 177 |
|
|
| 167 |
for (NodeIt nn(_graph); nn != INVALID; ++nn) {
|
|
| 168 |
if (nn != n && fa.minCut(nn) && (*_pred)[nn] == pn) {
|
|
| 169 |
(*_pred)[nn] = n; |
|
| 170 |
} |
|
| 171 |
} |
|
| 172 |
if ((*_pred)[pn] != INVALID && fa.minCut((*_pred)[pn])) {
|
|
| 173 |
(*_pred)[n] = (*_pred)[pn]; |
|
| 174 |
(*_pred)[pn] = n; |
|
| 175 |
(*_weight)[n] = (*_weight)[pn]; |
|
| 176 |
(*_weight)[pn] = fa.flowValue(); |
|
| 177 |
} |
|
| 178 | 178 |
} |
| ... | ... |
@@ -183,12 +183,12 @@ |
| 183 | 183 |
for (NodeIt n(_graph); n != INVALID; ++n) {
|
| 184 |
std::vector<Node> st; |
|
| 185 |
Node nn = n; |
|
| 186 |
while ((*_order)[nn] == -1) {
|
|
| 187 |
st.push_back(nn); |
|
| 188 |
nn = (*_pred)[nn]; |
|
| 189 |
} |
|
| 190 |
while (!st.empty()) {
|
|
| 191 |
(*_order)[st.back()] = index++; |
|
| 192 |
st.pop_back(); |
|
| 193 |
} |
|
| 184 |
std::vector<Node> st; |
|
| 185 |
Node nn = n; |
|
| 186 |
while ((*_order)[nn] == -1) {
|
|
| 187 |
st.push_back(nn); |
|
| 188 |
nn = (*_pred)[nn]; |
|
| 189 |
} |
|
| 190 |
while (!st.empty()) {
|
|
| 191 |
(*_order)[st.back()] = index++; |
|
| 192 |
st.pop_back(); |
|
| 193 |
} |
|
| 194 | 194 |
} |
| ... | ... |
@@ -199,3 +199,3 @@ |
| 199 | 199 |
///\name Execution Control |
| 200 |
|
|
| 200 |
|
|
| 201 | 201 |
///@{
|
| ... | ... |
@@ -209,3 +209,3 @@ |
| 209 | 209 |
} |
| 210 |
|
|
| 210 |
|
|
| 211 | 211 |
/// @} |
| ... | ... |
@@ -234,3 +234,3 @@ |
| 234 | 234 |
/// |
| 235 |
/// This function returns the weight of the predecessor edge of the |
|
| 235 |
/// This function returns the weight of the predecessor edge of the |
|
| 236 | 236 |
/// given node in the Gomory-Hu tree. |
| ... | ... |
@@ -256,3 +256,3 @@ |
| 256 | 256 |
/// This function returns the minimum cut value between the nodes |
| 257 |
/// \c s and \c t. |
|
| 257 |
/// \c s and \c t. |
|
| 258 | 258 |
/// It finds the nearest common ancestor of the given nodes in the |
| ... | ... |
@@ -265,11 +265,11 @@ |
| 265 | 265 |
Value value = std::numeric_limits<Value>::max(); |
| 266 |
|
|
| 266 |
|
|
| 267 | 267 |
while (sn != tn) {
|
| 268 |
if ((*_order)[sn] < (*_order)[tn]) {
|
|
| 269 |
if ((*_weight)[tn] <= value) value = (*_weight)[tn]; |
|
| 270 |
tn = (*_pred)[tn]; |
|
| 271 |
} else {
|
|
| 272 |
if ((*_weight)[sn] <= value) value = (*_weight)[sn]; |
|
| 273 |
sn = (*_pred)[sn]; |
|
| 274 |
|
|
| 268 |
if ((*_order)[sn] < (*_order)[tn]) {
|
|
| 269 |
if ((*_weight)[tn] <= value) value = (*_weight)[tn]; |
|
| 270 |
tn = (*_pred)[tn]; |
|
| 271 |
} else {
|
|
| 272 |
if ((*_weight)[sn] <= value) value = (*_weight)[sn]; |
|
| 273 |
sn = (*_pred)[sn]; |
|
| 274 |
} |
|
| 275 | 275 |
} |
| ... | ... |
@@ -296,7 +296,7 @@ |
| 296 | 296 |
template <typename CutMap> |
| 297 |
Value minCutMap(const Node& s, ///< |
|
| 297 |
Value minCutMap(const Node& s, ///< |
|
| 298 | 298 |
const Node& t, |
| 299 |
///< |
|
| 299 |
///< |
|
| 300 | 300 |
CutMap& cutMap |
| 301 |
///< |
|
| 301 |
///< |
|
| 302 | 302 |
) const {
|
| ... | ... |
@@ -306,19 +306,19 @@ |
| 306 | 306 |
Value value = std::numeric_limits<Value>::max(); |
| 307 |
|
|
| 307 |
|
|
| 308 | 308 |
while (sn != tn) {
|
| 309 |
if ((*_order)[sn] < (*_order)[tn]) {
|
|
| 310 |
if ((*_weight)[tn] <= value) {
|
|
| 311 |
|
|
| 309 |
if ((*_order)[sn] < (*_order)[tn]) {
|
|
| 310 |
if ((*_weight)[tn] <= value) {
|
|
| 311 |
rn = tn; |
|
| 312 | 312 |
s_root = false; |
| 313 |
value = (*_weight)[tn]; |
|
| 314 |
} |
|
| 315 |
tn = (*_pred)[tn]; |
|
| 316 |
} else {
|
|
| 317 |
if ((*_weight)[sn] <= value) {
|
|
| 318 |
rn = sn; |
|
| 313 |
value = (*_weight)[tn]; |
|
| 314 |
} |
|
| 315 |
tn = (*_pred)[tn]; |
|
| 316 |
} else {
|
|
| 317 |
if ((*_weight)[sn] <= value) {
|
|
| 318 |
rn = sn; |
|
| 319 | 319 |
s_root = true; |
| 320 |
value = (*_weight)[sn]; |
|
| 321 |
} |
|
| 322 |
sn = (*_pred)[sn]; |
|
| 323 |
} |
|
| 320 |
value = (*_weight)[sn]; |
|
| 321 |
} |
|
| 322 |
sn = (*_pred)[sn]; |
|
| 323 |
} |
|
| 324 | 324 |
} |
| ... | ... |
@@ -333,14 +333,14 @@ |
| 333 | 333 |
for (NodeIt n(_graph); n != INVALID; ++n) {
|
| 334 |
|
|
| 334 |
st.clear(); |
|
| 335 | 335 |
Node nn = n; |
| 336 |
while (!reached[nn]) {
|
|
| 337 |
st.push_back(nn); |
|
| 338 |
nn = (*_pred)[nn]; |
|
| 339 |
} |
|
| 340 |
while (!st.empty()) {
|
|
| 341 |
cutMap.set(st.back(), cutMap[nn]); |
|
| 342 |
st.pop_back(); |
|
| 343 |
} |
|
| 336 |
while (!reached[nn]) {
|
|
| 337 |
st.push_back(nn); |
|
| 338 |
nn = (*_pred)[nn]; |
|
| 339 |
} |
|
| 340 |
while (!st.empty()) {
|
|
| 341 |
cutMap.set(st.back(), cutMap[nn]); |
|
| 342 |
st.pop_back(); |
|
| 343 |
} |
|
| 344 | 344 |
} |
| 345 |
|
|
| 345 |
|
|
| 346 | 346 |
return value; |
| ... | ... |
@@ -353,3 +353,3 @@ |
| 353 | 353 |
/// Iterate on the nodes of a minimum cut |
| 354 |
|
|
| 354 |
|
|
| 355 | 355 |
/// This iterator class lists the nodes of a minimum cut found by |
| ... | ... |
@@ -446,7 +446,7 @@ |
| 446 | 446 |
}; |
| 447 |
|
|
| 447 |
|
|
| 448 | 448 |
friend class MinCutEdgeIt; |
| 449 |
|
|
| 449 |
|
|
| 450 | 450 |
/// Iterate on the edges of a minimum cut |
| 451 |
|
|
| 451 |
|
|
| 452 | 452 |
/// This iterator class lists the edges of a minimum cut found by |
| ... | ... |
@@ -483,3 +483,3 @@ |
| 483 | 483 |
} |
| 484 |
|
|
| 484 |
|
|
| 485 | 485 |
public: |
| ... | ... |
@@ -552,3 +552,3 @@ |
| 552 | 552 |
/// Postfix incrementation |
| 553 |
|
|
| 553 |
|
|
| 554 | 554 |
/// Postfix incrementation. |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -33,3 +33,3 @@ |
| 33 | 33 |
/// |
| 34 |
/// Implementation of the Hao-Orlin algorithm for finding a minimum cut |
|
| 34 |
/// Implementation of the Hao-Orlin algorithm for finding a minimum cut |
|
| 35 | 35 |
/// in a digraph. |
| ... | ... |
@@ -43,3 +43,3 @@ |
| 43 | 43 |
/// This class implements the Hao-Orlin algorithm for finding a minimum |
| 44 |
/// value cut in a directed graph \f$D=(V,A)\f$. |
|
| 44 |
/// value cut in a directed graph \f$D=(V,A)\f$. |
|
| 45 | 45 |
/// It takes a fixed node \f$ source \in V \f$ and |
| ... | ... |
@@ -60,3 +60,3 @@ |
| 60 | 60 |
/// algorithm or you can use the algorithm of Nagamochi and Ibaraki, |
| 61 |
/// which solves the undirected problem in \f$ O(nm + n^2 \log n) \f$ |
|
| 61 |
/// which solves the undirected problem in \f$ O(nm + n^2 \log n) \f$ |
|
| 62 | 62 |
/// time. It is implemented in the NagamochiIbaraki algorithm class. |
| ... | ... |
@@ -78,3 +78,3 @@ |
| 78 | 78 |
public: |
| 79 |
|
|
| 79 |
|
|
| 80 | 80 |
/// The digraph type of the algorithm |
| ... | ... |
@@ -849,3 +849,3 @@ |
| 849 | 849 |
/// This function initializes the internal data structures. It creates |
| 850 |
/// the maps and some bucket structures for the algorithm. |
|
| 850 |
/// the maps and some bucket structures for the algorithm. |
|
| 851 | 851 |
/// The given node is used as the source node for the push-relabel |
| ... | ... |
@@ -929,3 +929,3 @@ |
| 929 | 929 |
/// |
| 930 |
/// This function runs the algorithm. It uses the given \c source node, |
|
| 930 |
/// This function runs the algorithm. It uses the given \c source node, |
|
| 931 | 931 |
/// finds a proper \c target node and then calls the \ref init(), |
| ... | ... |
@@ -943,3 +943,3 @@ |
| 943 | 943 |
/// can be obtained using these functions.\n |
| 944 |
/// \ref run(), \ref calculateOut() or \ref calculateIn() |
|
| 944 |
/// \ref run(), \ref calculateOut() or \ref calculateIn() |
|
| 945 | 945 |
/// should be called before using them. |
| ... | ... |
@@ -952,3 +952,3 @@ |
| 952 | 952 |
/// |
| 953 |
/// \pre \ref run(), \ref calculateOut() or \ref calculateIn() |
|
| 953 |
/// \pre \ref run(), \ref calculateOut() or \ref calculateIn() |
|
| 954 | 954 |
/// must be called before using this function. |
| ... | ... |
@@ -971,3 +971,3 @@ |
| 971 | 971 |
/// |
| 972 |
/// \pre \ref run(), \ref calculateOut() or \ref calculateIn() |
|
| 972 |
/// \pre \ref run(), \ref calculateOut() or \ref calculateIn() |
|
| 973 | 973 |
/// must be called before using this function. |
| ... | ... |
@@ -564,3 +564,3 @@ |
| 564 | 564 |
template <typename TDGR> |
| 565 |
friend DigraphReader<TDGR> digraphReader(TDGR& digraph, |
|
| 565 |
friend DigraphReader<TDGR> digraphReader(TDGR& digraph, |
|
| 566 | 566 |
const std::string& fn); |
| ... | ... |
@@ -1196,3 +1196,3 @@ |
| 1196 | 1196 |
}; |
| 1197 |
|
|
| 1197 |
|
|
| 1198 | 1198 |
/// \ingroup lemon_io |
| ... | ... |
@@ -1203,3 +1203,3 @@ |
| 1203 | 1203 |
/// |
| 1204 |
/// With this function a digraph can be read from an |
|
| 1204 |
/// With this function a digraph can be read from an |
|
| 1205 | 1205 |
/// \ref lgf-format "LGF" file or input stream with several maps and |
| ... | ... |
@@ -1258,3 +1258,3 @@ |
| 1258 | 1258 |
class GraphReader; |
| 1259 |
|
|
| 1259 |
|
|
| 1260 | 1260 |
template <typename TGR> |
| ... | ... |
@@ -1395,3 +1395,3 @@ |
| 1395 | 1395 |
template <typename TGR> |
| 1396 |
friend GraphReader<TGR> graphReader(TGR& graph, const std::string& fn); |
|
| 1396 |
friend GraphReader<TGR> graphReader(TGR& graph, const std::string& fn); |
|
| 1397 | 1397 |
template <typename TGR> |
| ... | ... |
@@ -2079,5 +2079,5 @@ |
| 2079 | 2079 |
/// |
| 2080 |
/// This function just returns a \ref GraphReader class. |
|
| 2080 |
/// This function just returns a \ref GraphReader class. |
|
| 2081 | 2081 |
/// |
| 2082 |
/// With this function a graph can be read from an |
|
| 2082 |
/// With this function a graph can be read from an |
|
| 2083 | 2083 |
/// \ref lgf-format "LGF" file or input stream with several maps and |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -353,3 +353,3 @@ |
| 353 | 353 |
template <typename TDGR> |
| 354 |
DigraphWriter<TDGR> digraphWriter(const TDGR& digraph, |
|
| 354 |
DigraphWriter<TDGR> digraphWriter(const TDGR& digraph, |
|
| 355 | 355 |
std::ostream& os = std::cout); |
| ... | ... |
@@ -506,3 +506,3 @@ |
| 506 | 506 |
template <typename TDGR> |
| 507 |
friend DigraphWriter<TDGR> digraphWriter(const TDGR& digraph, |
|
| 507 |
friend DigraphWriter<TDGR> digraphWriter(const TDGR& digraph, |
|
| 508 | 508 |
std::ostream& os); |
| ... | ... |
@@ -919,3 +919,3 @@ |
| 919 | 919 |
/// |
| 920 |
/// This function just returns a \ref DigraphWriter class. |
|
| 920 |
/// This function just returns a \ref DigraphWriter class. |
|
| 921 | 921 |
/// |
| ... | ... |
@@ -959,3 +959,3 @@ |
| 959 | 959 |
template <typename TDGR> |
| 960 |
DigraphWriter<TDGR> digraphWriter(const TDGR& digraph, |
|
| 960 |
DigraphWriter<TDGR> digraphWriter(const TDGR& digraph, |
|
| 961 | 961 |
const std::string& fn) {
|
| ... | ... |
@@ -1103,3 +1103,3 @@ |
| 1103 | 1103 |
template <typename TGR> |
| 1104 |
friend GraphWriter<TGR> graphWriter(const TGR& graph, |
|
| 1104 |
friend GraphWriter<TGR> graphWriter(const TGR& graph, |
|
| 1105 | 1105 |
const std::string& fn); |
| ... | ... |
@@ -1107,3 +1107,3 @@ |
| 1107 | 1107 |
friend GraphWriter<TGR> graphWriter(const TGR& graph, const char *fn); |
| 1108 |
|
|
| 1108 |
|
|
| 1109 | 1109 |
GraphWriter(GraphWriter& other) |
| ... | ... |
@@ -1558,3 +1558,3 @@ |
| 1558 | 1558 |
/// |
| 1559 |
/// This function just returns a \ref GraphWriter class. |
|
| 1559 |
/// This function just returns a \ref GraphWriter class. |
|
| 1560 | 1560 |
/// |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -84,3 +84,3 @@ |
| 84 | 84 |
}; |
| 85 |
|
|
| 85 |
|
|
| 86 | 86 |
|
| ... | ... |
@@ -116,3 +116,3 @@ |
| 116 | 116 |
/// Default constructor |
| 117 |
|
|
| 117 |
|
|
| 118 | 118 |
/// \warning The default constructor sets the Col to an |
| ... | ... |
@@ -121,5 +121,5 @@ |
| 121 | 121 |
/// Invalid constructor \& conversion. |
| 122 |
|
|
| 122 |
|
|
| 123 | 123 |
/// This constructor initializes the Col to be invalid. |
| 124 |
/// \sa Invalid for more details. |
|
| 124 |
/// \sa Invalid for more details. |
|
| 125 | 125 |
Col(const Invalid&) : _id(-1) {}
|
| ... | ... |
@@ -158,3 +158,3 @@ |
| 158 | 158 |
/// Default constructor |
| 159 |
|
|
| 159 |
|
|
| 160 | 160 |
/// \warning The default constructor sets the iterator |
| ... | ... |
@@ -163,3 +163,3 @@ |
| 163 | 163 |
/// Sets the iterator to the first Col |
| 164 |
|
|
| 164 |
|
|
| 165 | 165 |
/// Sets the iterator to the first Col. |
| ... | ... |
@@ -171,3 +171,3 @@ |
| 171 | 171 |
/// Invalid constructor \& conversion |
| 172 |
|
|
| 172 |
|
|
| 173 | 173 |
/// Initialize the iterator to be invalid. |
| ... | ... |
@@ -176,3 +176,3 @@ |
| 176 | 176 |
/// Next column |
| 177 |
|
|
| 177 |
|
|
| 178 | 178 |
/// Assign the iterator to the next column. |
| ... | ... |
@@ -211,3 +211,3 @@ |
| 211 | 211 |
/// Default constructor |
| 212 |
|
|
| 212 |
|
|
| 213 | 213 |
/// \warning The default constructor sets the Row to an |
| ... | ... |
@@ -216,5 +216,5 @@ |
| 216 | 216 |
/// Invalid constructor \& conversion. |
| 217 |
|
|
| 217 |
|
|
| 218 | 218 |
/// This constructor initializes the Row to be invalid. |
| 219 |
/// \sa Invalid for more details. |
|
| 219 |
/// \sa Invalid for more details. |
|
| 220 | 220 |
Row(const Invalid&) : _id(-1) {}
|
| ... | ... |
@@ -226,3 +226,3 @@ |
| 226 | 226 |
/// Inequality operator |
| 227 |
|
|
| 227 |
|
|
| 228 | 228 |
/// \sa operator==(Row r) |
| ... | ... |
@@ -253,3 +253,3 @@ |
| 253 | 253 |
/// Default constructor |
| 254 |
|
|
| 254 |
|
|
| 255 | 255 |
/// \warning The default constructor sets the iterator |
| ... | ... |
@@ -258,3 +258,3 @@ |
| 258 | 258 |
/// Sets the iterator to the first Row |
| 259 |
|
|
| 259 |
|
|
| 260 | 260 |
/// Sets the iterator to the first Row. |
| ... | ... |
@@ -266,3 +266,3 @@ |
| 266 | 266 |
/// Invalid constructor \& conversion |
| 267 |
|
|
| 267 |
|
|
| 268 | 268 |
/// Initialize the iterator to be invalid. |
| ... | ... |
@@ -271,3 +271,3 @@ |
| 271 | 271 |
/// Next row |
| 272 |
|
|
| 272 |
|
|
| 273 | 273 |
/// Assign the iterator to the next row. |
| ... | ... |
@@ -349,3 +349,3 @@ |
| 349 | 349 |
/// Default constructor |
| 350 |
|
|
| 350 |
|
|
| 351 | 351 |
/// Construct an empty expression, the coefficients and |
| ... | ... |
@@ -450,5 +450,5 @@ |
| 450 | 450 |
///Iterator over the expression |
| 451 |
|
|
| 452 |
///The iterator iterates over the terms of the expression. |
|
| 453 |
|
|
| 451 |
|
|
| 452 |
///The iterator iterates over the terms of the expression. |
|
| 453 |
/// |
|
| 454 | 454 |
///\code |
| ... | ... |
@@ -466,3 +466,3 @@ |
| 466 | 466 |
/// Sets the iterator to the first term |
| 467 |
|
|
| 467 |
|
|
| 468 | 468 |
/// Sets the iterator to the first term of the expression. |
| ... | ... |
@@ -483,3 +483,3 @@ |
| 483 | 483 |
/// Next term |
| 484 |
|
|
| 484 |
|
|
| 485 | 485 |
/// Assign the iterator to the next term. |
| ... | ... |
@@ -495,5 +495,5 @@ |
| 495 | 495 |
/// Const iterator over the expression |
| 496 |
|
|
| 497 |
///The iterator iterates over the terms of the expression. |
|
| 498 |
|
|
| 496 |
|
|
| 497 |
///The iterator iterates over the terms of the expression. |
|
| 498 |
/// |
|
| 499 | 499 |
///\code |
| ... | ... |
@@ -511,3 +511,3 @@ |
| 511 | 511 |
/// Sets the iterator to the first term |
| 512 |
|
|
| 512 |
|
|
| 513 | 513 |
/// Sets the iterator to the first term of the expression. |
| ... | ... |
@@ -526,3 +526,3 @@ |
| 526 | 526 |
/// Next term |
| 527 |
|
|
| 527 |
|
|
| 528 | 528 |
/// Assign the iterator to the next term. |
| ... | ... |
@@ -675,3 +675,3 @@ |
| 675 | 675 |
/// Default constructor |
| 676 |
|
|
| 676 |
|
|
| 677 | 677 |
/// Construct an empty expression, the coefficients are |
| ... | ... |
@@ -710,3 +710,3 @@ |
| 710 | 710 |
/// \brief Removes the coefficients which's absolute value does |
| 711 |
/// not exceed \c epsilon. |
|
| 711 |
/// not exceed \c epsilon. |
|
| 712 | 712 |
void simplify(Value epsilon = 0.0) {
|
| ... | ... |
@@ -759,5 +759,5 @@ |
| 759 | 759 |
///Iterator over the expression |
| 760 |
|
|
| 761 |
///The iterator iterates over the terms of the expression. |
|
| 762 |
|
|
| 760 |
|
|
| 761 |
///The iterator iterates over the terms of the expression. |
|
| 762 |
/// |
|
| 763 | 763 |
///\code |
| ... | ... |
@@ -775,3 +775,3 @@ |
| 775 | 775 |
/// Sets the iterator to the first term |
| 776 |
|
|
| 776 |
|
|
| 777 | 777 |
/// Sets the iterator to the first term of the expression. |
| ... | ... |
@@ -793,3 +793,3 @@ |
| 793 | 793 |
/// Next term |
| 794 |
|
|
| 794 |
|
|
| 795 | 795 |
/// Assign the iterator to the next term. |
| ... | ... |
@@ -805,5 +805,5 @@ |
| 805 | 805 |
///Iterator over the expression |
| 806 |
|
|
| 807 |
///The iterator iterates over the terms of the expression. |
|
| 808 |
|
|
| 806 |
|
|
| 807 |
///The iterator iterates over the terms of the expression. |
|
| 808 |
/// |
|
| 809 | 809 |
///\code |
| ... | ... |
@@ -821,3 +821,3 @@ |
| 821 | 821 |
/// Sets the iterator to the first term |
| 822 |
|
|
| 822 |
|
|
| 823 | 823 |
/// Sets the iterator to the first term of the expression. |
| ... | ... |
@@ -836,3 +836,3 @@ |
| 836 | 836 |
/// Next term |
| 837 |
|
|
| 837 |
|
|
| 838 | 838 |
/// Assign the iterator to the next term. |
| ... | ... |
@@ -1805,6 +1805,6 @@ |
| 1805 | 1805 |
/// The variable is in the basis |
| 1806 |
BASIC, |
|
| 1806 |
BASIC, |
|
| 1807 | 1807 |
/// The variable is free, but not basic |
| 1808 | 1808 |
FREE, |
| 1809 |
/// The variable has active lower bound |
|
| 1809 |
/// The variable has active lower bound |
|
| 1810 | 1810 |
LOWER, |
| ... | ... |
@@ -1887,3 +1887,3 @@ |
| 1887 | 1887 |
/// Returns a component of the primal ray |
| 1888 |
|
|
| 1888 |
|
|
| 1889 | 1889 |
/// The primal ray is solution of the modified primal problem, |
| ... | ... |
@@ -1921,3 +1921,3 @@ |
| 1921 | 1921 |
/// Returns a component of the dual ray |
| 1922 |
|
|
| 1922 |
|
|
| 1923 | 1923 |
/// The dual ray is solution of the modified primal problem, where |
| ... | ... |
@@ -2063,3 +2063,3 @@ |
| 2063 | 2063 |
///The value of the objective function |
| 2064 |
|
|
| 2064 |
|
|
| 2065 | 2065 |
///\return |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -25,3 +25,3 @@ |
| 25 | 25 |
///\brief Skeleton file to implement LP/MIP solver interfaces |
| 26 |
/// |
|
| 26 |
/// |
|
| 27 | 27 |
///The classes in this file do nothing, but they can serve as skeletons when |
| ... | ... |
@@ -31,3 +31,3 @@ |
| 31 | 31 |
///A skeleton class to implement LP/MIP solver base interface |
| 32 |
|
|
| 32 |
|
|
| 33 | 33 |
///This class does nothing, but it can serve as a skeleton when |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -1820,3 +1820,3 @@ |
| 1820 | 1820 |
/// IdMap provides a unique and immutable id for each item of the |
| 1821 |
/// same type (\c Node, \c Arc or \c Edge) in a graph. This id is |
|
| 1821 |
/// same type (\c Node, \c Arc or \c Edge) in a graph. This id is |
|
| 1822 | 1822 |
/// - \b unique: different items get different ids, |
| ... | ... |
@@ -2275,3 +2275,3 @@ |
| 2275 | 2275 |
/// \brief Gives back the item belonging to a \e RangeId |
| 2276 |
/// |
|
| 2276 |
/// |
|
| 2277 | 2277 |
/// Gives back the item belonging to a \e RangeId. |
| ... | ... |
@@ -2501,3 +2501,3 @@ |
| 2501 | 2501 |
/// |
| 2502 |
/// \warning Besides \c addNode() and \c addArc(), a digraph structure |
|
| 2502 |
/// \warning Besides \c addNode() and \c addArc(), a digraph structure |
|
| 2503 | 2503 |
/// may provide alternative ways to modify the digraph. |
| ... | ... |
@@ -2517,3 +2517,3 @@ |
| 2517 | 2517 |
public: |
| 2518 |
|
|
| 2518 |
|
|
| 2519 | 2519 |
/// The graph type of InDegMap |
| ... | ... |
@@ -2631,3 +2631,3 @@ |
| 2631 | 2631 |
/// |
| 2632 |
/// \warning Besides \c addNode() and \c addArc(), a digraph structure |
|
| 2632 |
/// \warning Besides \c addNode() and \c addArc(), a digraph structure |
|
| 2633 | 2633 |
/// may provide alternative ways to modify the digraph. |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -43,3 +43,3 @@ |
| 43 | 43 |
/// for finding a maximum cardinality matching in a general undirected graph. |
| 44 |
/// It can be started from an arbitrary initial matching |
|
| 44 |
/// It can be started from an arbitrary initial matching |
|
| 45 | 45 |
/// (the default is the empty one). |
| ... | ... |
@@ -71,3 +71,3 @@ |
| 71 | 71 |
/// |
| 72 |
///These constants are used for indicating the Gallai-Edmonds |
|
| 72 |
///These constants are used for indicating the Gallai-Edmonds |
|
| 73 | 73 |
///decomposition of a graph. The nodes with status \c EVEN (or \c D) |
| ... | ... |
@@ -75,3 +75,3 @@ |
| 75 | 75 |
///status \c ODD (or \c A) form the canonical barrier, and the nodes |
| 76 |
///with status \c MATCHED (or \c C) induce a subgraph having a |
|
| 76 |
///with status \c MATCHED (or \c C) induce a subgraph having a |
|
| 77 | 77 |
///perfect matching. |
| ... | ... |
@@ -514,3 +514,3 @@ |
| 514 | 514 |
|
| 515 |
/// \brief Start Edmonds' algorithm with a heuristic improvement |
|
| 515 |
/// \brief Start Edmonds' algorithm with a heuristic improvement |
|
| 516 | 516 |
/// for dense graphs |
| ... | ... |
@@ -536,4 +536,4 @@ |
| 536 | 536 |
/// |
| 537 |
/// This function runs Edmonds' algorithm. An additional heuristic of |
|
| 538 |
/// postponing shrinks is used for relatively dense graphs |
|
| 537 |
/// This function runs Edmonds' algorithm. An additional heuristic of |
|
| 538 |
/// postponing shrinks is used for relatively dense graphs |
|
| 539 | 539 |
/// (for which <tt>m>=2*n</tt> holds). |
| ... | ... |
@@ -558,3 +558,3 @@ |
| 558 | 558 |
/// |
| 559 |
/// This function returns the size (cardinality) of the current matching. |
|
| 559 |
/// This function returns the size (cardinality) of the current matching. |
|
| 560 | 560 |
/// After run() it returns the size of the maximum matching in the graph. |
| ... | ... |
@@ -572,3 +572,3 @@ |
| 572 | 572 |
/// |
| 573 |
/// This function returns \c true if the given edge is in the current |
|
| 573 |
/// This function returns \c true if the given edge is in the current |
|
| 574 | 574 |
/// matching. |
| ... | ... |
@@ -581,3 +581,3 @@ |
| 581 | 581 |
/// This function returns the matching arc (or edge) incident to the |
| 582 |
/// given node in the current matching or \c INVALID if the node is |
|
| 582 |
/// given node in the current matching or \c INVALID if the node is |
|
| 583 | 583 |
/// not covered by the matching. |
| ... | ... |
@@ -597,3 +597,3 @@ |
| 597 | 597 |
/// |
| 598 |
/// This function returns the mate of the given node in the current |
|
| 598 |
/// This function returns the mate of the given node in the current |
|
| 599 | 599 |
/// matching or \c INVALID if the node is not covered by the matching. |
| ... | ... |
@@ -607,3 +607,3 @@ |
| 607 | 607 |
/// \name Dual Solution |
| 608 |
/// Functions to get the dual solution, i.e. the Gallai-Edmonds |
|
| 608 |
/// Functions to get the dual solution, i.e. the Gallai-Edmonds |
|
| 609 | 609 |
/// decomposition. |
| ... | ... |
@@ -650,4 +650,4 @@ |
| 650 | 650 |
/// |
| 651 |
/// The maximum weighted matching problem is to find a subset of the |
|
| 652 |
/// edges in an undirected graph with maximum overall weight for which |
|
| 651 |
/// The maximum weighted matching problem is to find a subset of the |
|
| 652 |
/// edges in an undirected graph with maximum overall weight for which |
|
| 653 | 653 |
/// each node has at most one incident edge. |
| ... | ... |
@@ -675,7 +675,7 @@ |
| 675 | 675 |
/// |
| 676 |
/// The algorithm can be executed with the run() function. |
|
| 676 |
/// The algorithm can be executed with the run() function. |
|
| 677 | 677 |
/// After it the matching (the primal solution) and the dual solution |
| 678 |
/// can be obtained using the query functions and the |
|
| 679 |
/// \ref MaxWeightedMatching::BlossomIt "BlossomIt" nested class, |
|
| 680 |
/// |
|
| 678 |
/// can be obtained using the query functions and the |
|
| 679 |
/// \ref MaxWeightedMatching::BlossomIt "BlossomIt" nested class, |
|
| 680 |
/// which is able to iterate on the nodes of a blossom. |
|
| 681 | 681 |
/// If the value type is integer, then the dual solution is multiplied |
| ... | ... |
@@ -684,3 +684,3 @@ |
| 684 | 684 |
/// \tparam GR The undirected graph type the algorithm runs on. |
| 685 |
/// \tparam WM The type edge weight map. The default type is |
|
| 685 |
/// \tparam WM The type edge weight map. The default type is |
|
| 686 | 686 |
/// \ref concepts::Graph::EdgeMap "GR::EdgeMap<int>". |
| ... | ... |
@@ -1722,3 +1722,3 @@ |
| 1722 | 1722 |
} |
| 1723 |
|
|
| 1723 |
|
|
| 1724 | 1724 |
_delta1->clear(); |
| ... | ... |
@@ -1870,3 +1870,3 @@ |
| 1870 | 1870 |
/// \name Primal Solution |
| 1871 |
/// Functions to get the primal solution, i.e. the maximum weighted |
|
| 1871 |
/// Functions to get the primal solution, i.e. the maximum weighted |
|
| 1872 | 1872 |
/// matching.\n |
| ... | ... |
@@ -1909,3 +1909,3 @@ |
| 1909 | 1909 |
/// |
| 1910 |
/// This function returns \c true if the given edge is in the found |
|
| 1910 |
/// This function returns \c true if the given edge is in the found |
|
| 1911 | 1911 |
/// matching. |
| ... | ... |
@@ -1920,3 +1920,3 @@ |
| 1920 | 1920 |
/// This function returns the matching arc (or edge) incident to the |
| 1921 |
/// given node in the found matching or \c INVALID if the node is |
|
| 1921 |
/// given node in the found matching or \c INVALID if the node is |
|
| 1922 | 1922 |
/// not covered by the matching. |
| ... | ... |
@@ -1938,3 +1938,3 @@ |
| 1938 | 1938 |
/// |
| 1939 |
/// This function returns the mate of the given node in the found |
|
| 1939 |
/// This function returns the mate of the given node in the found |
|
| 1940 | 1940 |
/// matching or \c INVALID if the node is not covered by the matching. |
| ... | ... |
@@ -1958,4 +1958,4 @@ |
| 1958 | 1958 |
/// |
| 1959 |
/// This function returns the value of the dual solution. |
|
| 1960 |
/// It should be equal to the primal value scaled by \ref dualScale |
|
| 1959 |
/// This function returns the value of the dual solution. |
|
| 1960 |
/// It should be equal to the primal value scaled by \ref dualScale |
|
| 1961 | 1961 |
/// "dual scale". |
| ... | ... |
@@ -2014,5 +2014,5 @@ |
| 2014 | 2014 |
/// |
| 2015 |
/// This class provides an iterator for obtaining the nodes of the |
|
| 2015 |
/// This class provides an iterator for obtaining the nodes of the |
|
| 2016 | 2016 |
/// given blossom. It lists a subset of the nodes. |
| 2017 |
/// Before using this iterator, you must allocate a |
|
| 2017 |
/// Before using this iterator, you must allocate a |
|
| 2018 | 2018 |
/// MaxWeightedMatching class and execute it. |
| ... | ... |
@@ -2025,4 +2025,4 @@ |
| 2025 | 2025 |
/// |
| 2026 |
/// \pre Either \ref MaxWeightedMatching::run() "algorithm.run()" or |
|
| 2027 |
/// \ref MaxWeightedMatching::start() "algorithm.start()" must be |
|
| 2026 |
/// \pre Either \ref MaxWeightedMatching::run() "algorithm.run()" or |
|
| 2027 |
/// \ref MaxWeightedMatching::start() "algorithm.start()" must be |
|
| 2028 | 2028 |
/// called before initializing this iterator. |
| ... | ... |
@@ -2079,4 +2079,4 @@ |
| 2079 | 2079 |
/// |
| 2080 |
/// The maximum weighted perfect matching problem is to find a subset of |
|
| 2081 |
/// the edges in an undirected graph with maximum overall weight for which |
|
| 2080 |
/// The maximum weighted perfect matching problem is to find a subset of |
|
| 2081 |
/// the edges in an undirected graph with maximum overall weight for which |
|
| 2082 | 2082 |
/// each node has exactly one incident edge. |
| ... | ... |
@@ -2103,7 +2103,7 @@ |
| 2103 | 2103 |
/// |
| 2104 |
/// The algorithm can be executed with the run() function. |
|
| 2104 |
/// The algorithm can be executed with the run() function. |
|
| 2105 | 2105 |
/// After it the matching (the primal solution) and the dual solution |
| 2106 |
/// can be obtained using the query functions and the |
|
| 2107 |
/// \ref MaxWeightedPerfectMatching::BlossomIt "BlossomIt" nested class, |
|
| 2108 |
/// |
|
| 2106 |
/// can be obtained using the query functions and the |
|
| 2107 |
/// \ref MaxWeightedPerfectMatching::BlossomIt "BlossomIt" nested class, |
|
| 2108 |
/// which is able to iterate on the nodes of a blossom. |
|
| 2109 | 2109 |
/// If the value type is integer, then the dual solution is multiplied |
| ... | ... |
@@ -2112,3 +2112,3 @@ |
| 2112 | 2112 |
/// \tparam GR The undirected graph type the algorithm runs on. |
| 2113 |
/// \tparam WM The type edge weight map. The default type is |
|
| 2113 |
/// \tparam WM The type edge weight map. The default type is |
|
| 2114 | 2114 |
/// \ref concepts::Graph::EdgeMap "GR::EdgeMap<int>". |
| ... | ... |
@@ -3117,3 +3117,3 @@ |
| 3117 | 3117 |
/// \name Primal Solution |
| 3118 |
/// Functions to get the primal solution, i.e. the maximum weighted |
|
| 3118 |
/// Functions to get the primal solution, i.e. the maximum weighted |
|
| 3119 | 3119 |
/// perfect matching.\n |
| ... | ... |
@@ -3141,3 +3141,3 @@ |
| 3141 | 3141 |
/// |
| 3142 |
/// This function returns \c true if the given edge is in the found |
|
| 3142 |
/// This function returns \c true if the given edge is in the found |
|
| 3143 | 3143 |
/// matching. |
| ... | ... |
@@ -3152,3 +3152,3 @@ |
| 3152 | 3152 |
/// This function returns the matching arc (or edge) incident to the |
| 3153 |
/// given node in the found matching or \c INVALID if the node is |
|
| 3153 |
/// given node in the found matching or \c INVALID if the node is |
|
| 3154 | 3154 |
/// not covered by the matching. |
| ... | ... |
@@ -3170,3 +3170,3 @@ |
| 3170 | 3170 |
/// |
| 3171 |
/// This function returns the mate of the given node in the found |
|
| 3171 |
/// This function returns the mate of the given node in the found |
|
| 3172 | 3172 |
/// matching or \c INVALID if the node is not covered by the matching. |
| ... | ... |
@@ -3189,4 +3189,4 @@ |
| 3189 | 3189 |
/// |
| 3190 |
/// This function returns the value of the dual solution. |
|
| 3191 |
/// It should be equal to the primal value scaled by \ref dualScale |
|
| 3190 |
/// This function returns the value of the dual solution. |
|
| 3191 |
/// It should be equal to the primal value scaled by \ref dualScale |
|
| 3192 | 3192 |
/// "dual scale". |
| ... | ... |
@@ -3245,5 +3245,5 @@ |
| 3245 | 3245 |
/// |
| 3246 |
/// This class provides an iterator for obtaining the nodes of the |
|
| 3246 |
/// This class provides an iterator for obtaining the nodes of the |
|
| 3247 | 3247 |
/// given blossom. It lists a subset of the nodes. |
| 3248 |
/// Before using this iterator, you must allocate a |
|
| 3248 |
/// Before using this iterator, you must allocate a |
|
| 3249 | 3249 |
/// MaxWeightedPerfectMatching class and execute it. |
| ... | ... |
@@ -3256,4 +3256,4 @@ |
| 3256 | 3256 |
/// |
| 3257 |
/// \pre Either \ref MaxWeightedPerfectMatching::run() "algorithm.run()" |
|
| 3258 |
/// or \ref MaxWeightedPerfectMatching::start() "algorithm.start()" |
|
| 3257 |
/// \pre Either \ref MaxWeightedPerfectMatching::run() "algorithm.run()" |
|
| 3258 |
/// or \ref MaxWeightedPerfectMatching::start() "algorithm.start()" |
|
| 3259 | 3259 |
/// must be called before initializing this iterator. |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -129,4 +129,4 @@ |
| 129 | 129 |
|
| 130 |
/// \brief The \ref MinCostArborescenceDefaultTraits "traits class" |
|
| 131 |
/// of the algorithm. |
|
| 130 |
/// \brief The \ref MinCostArborescenceDefaultTraits "traits class" |
|
| 131 |
/// of the algorithm. |
|
| 132 | 132 |
typedef TR Traits; |
| ... | ... |
@@ -437,3 +437,3 @@ |
| 437 | 437 |
/// \c PredMap type. |
| 438 |
/// It must meet the \ref concepts::WriteMap "WriteMap" concept, |
|
| 438 |
/// It must meet the \ref concepts::WriteMap "WriteMap" concept, |
|
| 439 | 439 |
/// and its value type must be the \c Arc type of the digraph. |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -97,3 +97,3 @@ |
| 97 | 97 |
}; |
| 98 |
|
|
| 98 |
|
|
| 99 | 99 |
/// \brief Constants for selecting the type of the supply constraints. |
| ... | ... |
@@ -115,3 +115,3 @@ |
| 115 | 115 |
}; |
| 116 |
|
|
| 116 |
|
|
| 117 | 117 |
/// \brief Constants for selecting the pivot rule. |
| ... | ... |
@@ -158,3 +158,3 @@ |
| 158 | 158 |
}; |
| 159 |
|
|
| 159 |
|
|
| 160 | 160 |
private: |
| ... | ... |
@@ -225,3 +225,3 @@ |
| 225 | 225 |
public: |
| 226 |
|
|
| 226 |
|
|
| 227 | 227 |
/// \brief Constant for infinite upper bounds (capacities). |
| ... | ... |
@@ -646,3 +646,3 @@ |
| 646 | 646 |
"The cost type of NetworkSimplex must be signed"); |
| 647 |
|
|
| 647 |
|
|
| 648 | 648 |
// Resize vectors |
| ... | ... |
@@ -686,3 +686,3 @@ |
| 686 | 686 |
} |
| 687 |
|
|
| 687 |
|
|
| 688 | 688 |
// Initialize maps |
| ... | ... |
@@ -811,3 +811,3 @@ |
| 811 | 811 |
} |
| 812 |
|
|
| 812 |
|
|
| 813 | 813 |
/// \brief Set the type of the supply constraints. |
| ... | ... |
@@ -837,3 +837,3 @@ |
| 837 | 837 |
/// The paramters can be specified using functions \ref lowerMap(), |
| 838 |
/// \ref upperMap(), \ref costMap(), \ref supplyMap(), \ref stSupply(), |
|
| 838 |
/// \ref upperMap(), \ref costMap(), \ref supplyMap(), \ref stSupply(), |
|
| 839 | 839 |
/// \ref supplyType(). |
| ... | ... |
@@ -1056,3 +1056,3 @@ |
| 1056 | 1056 |
} |
| 1057 |
|
|
| 1057 |
|
|
| 1058 | 1058 |
// Set data for the artificial root node |
| ... | ... |
@@ -1230,3 +1230,3 @@ |
| 1230 | 1230 |
e = _pred[u]; |
| 1231 |
d = _forward[u] ? |
|
| 1231 |
d = _forward[u] ? |
|
| 1232 | 1232 |
(_cap[e] == INF ? INF : _cap[e] - _flow[e]) : _flow[e]; |
| ... | ... |
@@ -1437,3 +1437,3 @@ |
| 1437 | 1437 |
} |
| 1438 |
|
|
| 1438 |
|
|
| 1439 | 1439 |
// Check feasibility |
| ... | ... |
@@ -1454,3 +1454,3 @@ |
| 1454 | 1454 |
} |
| 1455 |
|
|
| 1455 |
|
|
| 1456 | 1456 |
// Shift potentials to meet the requirements of the GEQ/LEQ type |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -968,3 +968,3 @@ |
| 968 | 968 |
|
| 969 |
|
|
| 969 |
|
|
| 970 | 970 |
template <typename From, typename To, |
| ... | ... |
@@ -974,3 +974,3 @@ |
| 974 | 974 |
PathCopySelectorForward<From, To>::copy(from, to); |
| 975 |
} |
|
| 975 |
} |
|
| 976 | 976 |
}; |
| ... | ... |
@@ -981,3 +981,3 @@ |
| 981 | 981 |
PathCopySelectorBackward<From, To>::copy(from, to); |
| 982 |
} |
|
| 982 |
} |
|
| 983 | 983 |
}; |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -538,6 +538,6 @@ |
| 538 | 538 |
} |
| 539 |
for (NodeIt n(_graph); n != INVALID; ++n) |
|
| 539 |
for (NodeIt n(_graph); n != INVALID; ++n) |
|
| 540 | 540 |
if(n!=_source && n!=_target && _tolerance.positive((*_excess)[n])) |
| 541 | 541 |
_level->activate(n); |
| 542 |
|
|
| 542 |
|
|
| 543 | 543 |
return true; |
| ... | ... |
@@ -569,3 +569,3 @@ |
| 569 | 569 |
--num; |
| 570 |
|
|
| 570 |
|
|
| 571 | 571 |
Value excess = (*_excess)[n]; |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -85,3 +85,3 @@ |
| 85 | 85 |
i = const_bfs_test.queueSize(); |
| 86 |
|
|
| 86 |
|
|
| 87 | 87 |
bfs_test.start(); |
| ... | ... |
@@ -106,3 +106,3 @@ |
| 106 | 106 |
::Create bfs_test(G); |
| 107 |
|
|
| 107 |
|
|
| 108 | 108 |
concepts::ReadWriteMap<Node,Arc> pred_map; |
| ... | ... |
@@ -111,3 +111,3 @@ |
| 111 | 111 |
concepts::WriteMap<Node,bool> processed_map; |
| 112 |
|
|
| 112 |
|
|
| 113 | 113 |
bfs_test |
| ... | ... |
@@ -121,3 +121,3 @@ |
| 121 | 121 |
bfs_test.run(); |
| 122 |
|
|
| 122 |
|
|
| 123 | 123 |
bfs_test.init(); |
| ... | ... |
@@ -130,3 +130,3 @@ |
| 130 | 130 |
i = bfs_test.queueSize(); |
| 131 |
|
|
| 131 |
|
|
| 132 | 132 |
bfs_test.start(); |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -83,3 +83,3 @@ |
| 83 | 83 |
const CirculationType& const_circ_test = circ_test; |
| 84 |
|
|
| 84 |
|
|
| 85 | 85 |
circ_test |
| ... | ... |
@@ -99,3 +99,3 @@ |
| 99 | 99 |
const_circ_test.barrierMap(bar); |
| 100 |
|
|
| 100 |
|
|
| 101 | 101 |
ignore_unused_variable_warning(fm); |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -31,3 +31,3 @@ |
| 31 | 31 |
typedef Undirector<Digraph> Graph; |
| 32 |
|
|
| 32 |
|
|
| 33 | 33 |
{
|
| ... | ... |
@@ -36,3 +36,3 @@ |
| 36 | 36 |
Graph g(d); |
| 37 |
|
|
| 37 |
|
|
| 38 | 38 |
check(stronglyConnected(d), "The empty digraph is strongly connected"); |
| ... | ... |
@@ -50,3 +50,3 @@ |
| 50 | 50 |
"The empty graph has 0 bi-edge-connected component"); |
| 51 |
|
|
| 51 |
|
|
| 52 | 52 |
check(dag(d), "The empty digraph is DAG."); |
| ... | ... |
@@ -84,3 +84,3 @@ |
| 84 | 84 |
"This graph has 1 bi-edge-connected component"); |
| 85 |
|
|
| 85 |
|
|
| 86 | 86 |
check(dag(d), "This digraph is DAG."); |
| ... | ... |
@@ -103,3 +103,3 @@ |
| 103 | 103 |
Graph g(d); |
| 104 |
|
|
| 104 |
|
|
| 105 | 105 |
Digraph::Node n1 = d.addNode(); |
| ... | ... |
@@ -110,3 +110,3 @@ |
| 110 | 110 |
Digraph::Node n6 = d.addNode(); |
| 111 |
|
|
| 111 |
|
|
| 112 | 112 |
d.addArc(n1, n3); |
| ... | ... |
@@ -138,5 +138,5 @@ |
| 138 | 138 |
check(!simpleGraph(g), "This graph is not simple."); |
| 139 |
|
|
| 139 |
|
|
| 140 | 140 |
d.addArc(n3, n3); |
| 141 |
|
|
| 141 |
|
|
| 142 | 142 |
check(!loopFree(d), "This digraph is not loop-free."); |
| ... | ... |
@@ -144,8 +144,8 @@ |
| 144 | 144 |
check(!simpleGraph(d), "This digraph is not simple."); |
| 145 |
|
|
| 145 |
|
|
| 146 | 146 |
d.addArc(n3, n2); |
| 147 |
|
|
| 147 |
|
|
| 148 | 148 |
check(!parallelFree(d), "This digraph is not parallel-free."); |
| 149 | 149 |
} |
| 150 |
|
|
| 150 |
|
|
| 151 | 151 |
{
|
| ... | ... |
@@ -154,3 +154,3 @@ |
| 154 | 154 |
Graph g(d); |
| 155 |
|
|
| 155 |
|
|
| 156 | 156 |
Digraph::Node n1 = d.addNode(); |
| ... | ... |
@@ -174,3 +174,3 @@ |
| 174 | 174 |
d.addArc(n7, n6); |
| 175 |
|
|
| 175 |
|
|
| 176 | 176 |
check(!stronglyConnected(d), "This digraph is not strongly connected"); |
| ... | ... |
@@ -237,3 +237,3 @@ |
| 237 | 237 |
Digraph::NodeMap<int> order(d); |
| 238 |
|
|
| 238 |
|
|
| 239 | 239 |
Digraph::Node belt = d.addNode(); |
| ... | ... |
@@ -257,3 +257,3 @@ |
| 257 | 257 |
d.addArc(necktie, coat); |
| 258 |
|
|
| 258 |
|
|
| 259 | 259 |
check(dag(d), "This digraph is DAG."); |
| ... | ... |
@@ -269,3 +269,3 @@ |
| 269 | 269 |
ListGraph::NodeMap<bool> map(g); |
| 270 |
|
|
| 270 |
|
|
| 271 | 271 |
ListGraph::Node n1 = g.addNode(); |
| ... | ... |
@@ -285,6 +285,6 @@ |
| 285 | 285 |
g.addEdge(n5, n7); |
| 286 |
|
|
| 286 |
|
|
| 287 | 287 |
check(bipartite(g), "This graph is bipartite"); |
| 288 | 288 |
check(bipartitePartitions(g, map), "This graph is bipartite"); |
| 289 |
|
|
| 289 |
|
|
| 290 | 290 |
check(map[n1] == map[n2] && map[n1] == map[n6] && map[n1] == map[n7], |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -88,3 +88,3 @@ |
| 88 | 88 |
i = const_dfs_test.queueSize(); |
| 89 |
|
|
| 89 |
|
|
| 90 | 90 |
dfs_test.start(); |
| ... | ... |
@@ -114,3 +114,3 @@ |
| 114 | 114 |
concepts::WriteMap<Node,bool> processed_map; |
| 115 |
|
|
| 115 |
|
|
| 116 | 116 |
dfs_test |
| ... | ... |
@@ -131,3 +131,3 @@ |
| 131 | 131 |
i = dfs_test.queueSize(); |
| 132 |
|
|
| 132 |
|
|
| 133 | 133 |
dfs_test.start(); |
| ... | ... |
@@ -221,3 +221,3 @@ |
| 221 | 221 |
} |
| 222 |
|
|
| 222 |
|
|
| 223 | 223 |
{
|
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -87,3 +87,3 @@ |
| 87 | 87 |
i = const_dijkstra_test.queueSize(); |
| 88 |
|
|
| 88 |
|
|
| 89 | 89 |
dijkstra_test.start(); |
| ... | ... |
@@ -111,3 +111,3 @@ |
| 111 | 111 |
::SetStandardHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > > |
| 112 |
::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> >, |
|
| 112 |
::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> >, |
|
| 113 | 113 |
concepts::ReadWriteMap<Node,int> > |
| ... | ... |
@@ -121,3 +121,3 @@ |
| 121 | 121 |
BinHeap<VType, concepts::ReadWriteMap<Node,int> > heap(heap_cross_ref); |
| 122 |
|
|
| 122 |
|
|
| 123 | 123 |
dijkstra_test |
| ... | ... |
@@ -138,3 +138,3 @@ |
| 138 | 138 |
i = dijkstra_test.queueSize(); |
| 139 |
|
|
| 139 |
|
|
| 140 | 140 |
dijkstra_test.start(); |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -87,3 +87,3 @@ |
| 87 | 87 |
typedef Undirector<Digraph> Graph; |
| 88 |
|
|
| 88 |
|
|
| 89 | 89 |
{
|
| ... | ... |
@@ -91,3 +91,3 @@ |
| 91 | 91 |
Graph g(d); |
| 92 |
|
|
| 92 |
|
|
| 93 | 93 |
checkDiEulerIt(d); |
| ... | ... |
@@ -130,3 +130,3 @@ |
| 130 | 130 |
Digraph::Node n3 = d.addNode(); |
| 131 |
|
|
| 131 |
|
|
| 132 | 132 |
d.addArc(n1, n2); |
| ... | ... |
@@ -155,3 +155,3 @@ |
| 155 | 155 |
Digraph::Node n6 = d.addNode(); |
| 156 |
|
|
| 156 |
|
|
| 157 | 157 |
d.addArc(n1, n2); |
| ... | ... |
@@ -191,3 +191,3 @@ |
| 191 | 191 |
Digraph::Node n5 = d.addNode(); |
| 192 |
|
|
| 192 |
|
|
| 193 | 193 |
d.addArc(n1, n2); |
| ... | ... |
@@ -213,3 +213,3 @@ |
| 213 | 213 |
Digraph::Node n3 = d.addNode(); |
| 214 |
|
|
| 214 |
|
|
| 215 | 215 |
d.addArc(n1, n2); |
| 1 |
/* -*- mode: C++; indent-tabs-mode: nil; -*- |
|
| 2 |
* |
|
| 3 |
* This file is a part of LEMON, a generic C++ optimization library. |
|
| 4 |
* |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
|
| 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
|
| 8 |
* |
|
| 9 |
* Permission to use, modify and distribute this software is granted |
|
| 10 |
* provided that this copyright notice appears in all copies. For |
|
| 11 |
* precise terms see the accompanying LICENSE file. |
|
| 12 |
* |
|
| 13 |
* This software is provided "AS IS" with no warranty of any kind, |
|
| 14 |
* express or implied, and with no claim as to its suitability for any |
|
| 15 |
* purpose. |
|
| 16 |
* |
|
| 17 |
*/ |
|
| 18 |
|
|
| 1 | 19 |
#include <iostream> |
| ... | ... |
@@ -35,3 +53,3 @@ |
| 35 | 53 |
"target 3\n"; |
| 36 |
|
|
| 54 |
|
|
| 37 | 55 |
void checkGomoryHuCompile() |
| ... | ... |
@@ -71,3 +89,3 @@ |
| 71 | 89 |
int cutValue(const Graph& graph, const BoolNodeMap& cut, |
| 72 |
|
|
| 90 |
const IntEdgeMap& capacity) {
|
|
| 73 | 91 |
|
| ... | ... |
@@ -109,3 +127,3 @@ |
| 109 | 127 |
for(GomoryHu<Graph>::MinCutEdgeIt a(ght, u, v);a!=INVALID;++a) |
| 110 |
sum+=capacity[a]; |
|
| 128 |
sum+=capacity[a]; |
|
| 111 | 129 |
check(sum == ght.minCutValue(u, v), "Problem with MinCutEdgeIt"); |
| ... | ... |
@@ -120,3 +138,3 @@ |
| 120 | 138 |
} |
| 121 |
|
|
| 139 |
|
|
| 122 | 140 |
return 0; |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -72,3 +72,3 @@ |
| 72 | 72 |
node(fn, tn).arc(fa, ta).run(); |
| 73 |
|
|
| 73 |
|
|
| 74 | 74 |
check(countNodes(from) == countNodes(to), "Wrong copy."); |
| ... | ... |
@@ -100,3 +100,3 @@ |
| 100 | 100 |
digraphCopy(from, to).run(); |
| 101 |
|
|
| 101 |
|
|
| 102 | 102 |
check(countNodes(from) == countNodes(to), "Wrong copy."); |
| ... | ... |
@@ -202,3 +202,3 @@ |
| 202 | 202 |
graphCopy(from, to).run(); |
| 203 |
|
|
| 203 |
|
|
| 204 | 204 |
check(countNodes(from) == countNodes(to), "Wrong copy."); |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -85,3 +85,3 @@ |
| 85 | 85 |
template <typename Graph, typename CapMap, typename CutMap> |
| 86 |
typename CapMap::Value |
|
| 86 |
typename CapMap::Value |
|
| 87 | 87 |
cutValue(const Graph& graph, const CapMap& cap, const CutMap& cut) |
| ... | ... |
@@ -112,3 +112,3 @@ |
| 112 | 112 |
ho.minCutMap(cut); |
| 113 |
|
|
| 113 |
|
|
| 114 | 114 |
check(ho.minCutValue() == 1, "Wrong cut value"); |
| ... | ... |
@@ -128,3 +128,3 @@ |
| 128 | 128 |
ho.minCutMap(cut); |
| 129 |
|
|
| 129 |
|
|
| 130 | 130 |
check(ho.minCutValue() == 1, "Wrong cut value"); |
| ... | ... |
@@ -132,6 +132,6 @@ |
| 132 | 132 |
} |
| 133 |
|
|
| 133 |
|
|
| 134 | 134 |
typedef Undirector<SmartDigraph> UGraph; |
| 135 | 135 |
UGraph ugraph(graph); |
| 136 |
|
|
| 136 |
|
|
| 137 | 137 |
{
|
| ... | ... |
@@ -140,3 +140,3 @@ |
| 140 | 140 |
ho.minCutMap(cut); |
| 141 |
|
|
| 141 |
|
|
| 142 | 142 |
check(ho.minCutValue() == 2, "Wrong cut value"); |
| ... | ... |
@@ -148,3 +148,3 @@ |
| 148 | 148 |
ho.minCutMap(cut); |
| 149 |
|
|
| 149 |
|
|
| 150 | 150 |
check(ho.minCutValue() == 5, "Wrong cut value"); |
| ... | ... |
@@ -156,3 +156,3 @@ |
| 156 | 156 |
ho.minCutMap(cut); |
| 157 |
|
|
| 157 |
|
|
| 158 | 158 |
check(ho.minCutValue() == 5, "Wrong cut value"); |
| ... | ... |
@@ -65,6 +65,6 @@ |
| 65 | 65 |
|
| 66 |
int main() |
|
| 66 |
int main() |
|
| 67 | 67 |
{
|
| 68 | 68 |
{
|
| 69 |
ListDigraph d; |
|
| 69 |
ListDigraph d; |
|
| 70 | 70 |
ListDigraph::Node s,t; |
| ... | ... |
@@ -95,3 +95,3 @@ |
| 95 | 95 |
{
|
| 96 |
ListDigraph d; |
|
| 96 |
ListDigraph d; |
|
| 97 | 97 |
std::istringstream input(test_lgf_nomap); |
| ... | ... |
@@ -112,3 +112,3 @@ |
| 112 | 112 |
{
|
| 113 |
ListDigraph d; |
|
| 113 |
ListDigraph d; |
|
| 114 | 114 |
std::istringstream input(test_lgf_bad1); |
| ... | ... |
@@ -119,3 +119,3 @@ |
| 119 | 119 |
} |
| 120 |
catch (FormatError& error) |
|
| 120 |
catch (FormatError& error) |
|
| 121 | 121 |
{
|
| ... | ... |
@@ -141,3 +141,3 @@ |
| 141 | 141 |
{
|
| 142 |
ListDigraph d; |
|
| 142 |
ListDigraph d; |
|
| 143 | 143 |
std::istringstream input(test_lgf_bad2); |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -72,4 +72,6 @@ |
| 72 | 72 |
checkConcept<ReadWriteMap<A,C>, ReadWriteMap<A,C> >(); |
| 73 |
checkConcept<ReferenceMap<A,B,B&,const B&>, ReferenceMap<A,B,B&,const B&> >(); |
|
| 74 |
checkConcept<ReferenceMap<A,C,C&,const C&>, ReferenceMap<A,C,C&,const C&> >(); |
|
| 73 |
checkConcept<ReferenceMap<A,B,B&,const B&>, |
|
| 74 |
ReferenceMap<A,B,B&,const B&> >(); |
|
| 75 |
checkConcept<ReferenceMap<A,C,C&,const C&>, |
|
| 76 |
ReferenceMap<A,C,C&,const C&> >(); |
|
| 75 | 77 |
|
| ... | ... |
@@ -202,3 +204,4 @@ |
| 202 | 204 |
checkConcept<ReadMap<A,B>, MapToFunctor<ReadMap<A,B> > >(); |
| 203 |
MapToFunctor<ReadMap<A,B> > map = |
|
| 205 |
MapToFunctor<ReadMap<A,B> > map = |
|
| 206 |
MapToFunctor<ReadMap<A,B> >(ReadMap<A,B>()); |
|
| 204 | 207 |
|
| ... | ... |
@@ -351,3 +354,3 @@ |
| 351 | 354 |
} |
| 352 |
|
|
| 355 |
|
|
| 353 | 356 |
// CrossRefMap |
| ... | ... |
@@ -359,3 +362,3 @@ |
| 359 | 362 |
CrossRefMap<Graph, Node, int> >(); |
| 360 |
|
|
| 363 |
|
|
| 361 | 364 |
Graph gr; |
| ... | ... |
@@ -364,3 +367,3 @@ |
| 364 | 367 |
CRMap map(gr); |
| 365 |
|
|
| 368 |
|
|
| 366 | 369 |
Node n0 = gr.addNode(); |
| ... | ... |
@@ -368,3 +371,3 @@ |
| 368 | 371 |
Node n2 = gr.addNode(); |
| 369 |
|
|
| 372 |
|
|
| 370 | 373 |
map.set(n0, 'A'); |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -136,3 +136,3 @@ |
| 136 | 136 |
mat_test.run(); |
| 137 |
|
|
| 137 |
|
|
| 138 | 138 |
const_mat_test.matchingSize(); |
| ... | ... |
@@ -145,3 +145,3 @@ |
| 145 | 145 |
|
| 146 |
MaxMatching<Graph>::Status stat = |
|
| 146 |
MaxMatching<Graph>::Status stat = |
|
| 147 | 147 |
const_mat_test.status(n); |
| ... | ... |
@@ -172,3 +172,3 @@ |
| 172 | 172 |
mat_test.run(); |
| 173 |
|
|
| 173 |
|
|
| 174 | 174 |
const_mat_test.matchingWeight(); |
| ... | ... |
@@ -181,3 +181,3 @@ |
| 181 | 181 |
const_mat_test.mate(n); |
| 182 |
|
|
| 182 |
|
|
| 183 | 183 |
int k = 0; |
| ... | ... |
@@ -209,3 +209,3 @@ |
| 209 | 209 |
mat_test.run(); |
| 210 |
|
|
| 210 |
|
|
| 211 | 211 |
const_mat_test.matchingWeight(); |
| ... | ... |
@@ -217,3 +217,3 @@ |
| 217 | 217 |
const_mat_test.mate(n); |
| 218 |
|
|
| 218 |
|
|
| 219 | 219 |
int k = 0; |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -112,3 +112,3 @@ |
| 112 | 112 |
i = const_mcarb_test.queueSize(); |
| 113 |
|
|
| 113 |
|
|
| 114 | 114 |
c = const_mcarb_test.arborescenceCost(); |
| ... | ... |
@@ -122,3 +122,3 @@ |
| 122 | 122 |
b = const_mcarb_test.processed(n); |
| 123 |
|
|
| 123 |
|
|
| 124 | 124 |
i = const_mcarb_test.dualNum(); |
| ... | ... |
@@ -127,3 +127,3 @@ |
| 127 | 127 |
c = const_mcarb_test.dualValue(i); |
| 128 |
|
|
| 128 |
|
|
| 129 | 129 |
ignore_unused_variable_warning(am); |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -49,3 +49,3 @@ |
| 49 | 49 |
" 12 -20 -27 0 -30 -30 -20\n" |
| 50 |
"\n" |
|
| 50 |
"\n" |
|
| 51 | 51 |
"@arcs\n" |
| ... | ... |
@@ -95,3 +95,3 @@ |
| 95 | 95 |
checkConcept<concepts::Digraph, GR>(); |
| 96 |
|
|
| 96 |
|
|
| 97 | 97 |
const Constraints& me = *this; |
| ... | ... |
@@ -124,3 +124,3 @@ |
| 124 | 124 |
typedef concepts::WriteMap<Node, Cost> PotMap; |
| 125 |
|
|
| 125 |
|
|
| 126 | 126 |
GR g; |
| ... | ... |
@@ -178,3 +178,3 @@ |
| 178 | 178 |
bool checkPotential( const GR& gr, const LM& lower, const UM& upper, |
| 179 |
const CM& cost, const SM& supply, const FM& flow, |
|
| 179 |
const CM& cost, const SM& supply, const FM& flow, |
|
| 180 | 180 |
const PM& pi, SupplyType type ) |
| ... | ... |
@@ -191,3 +191,3 @@ |
| 191 | 191 |
} |
| 192 |
|
|
| 192 |
|
|
| 193 | 193 |
for (NodeIt n(gr); opt && n != INVALID; ++n) {
|
| ... | ... |
@@ -204,3 +204,3 @@ |
| 204 | 204 |
} |
| 205 |
|
|
| 205 |
|
|
| 206 | 206 |
return opt; |
| ... | ... |
@@ -229,3 +229,3 @@ |
| 229 | 229 |
} |
| 230 |
|
|
| 230 |
|
|
| 231 | 231 |
for (NodeIt n(gr); n != INVALID; ++n) {
|
| ... | ... |
@@ -238,3 +238,3 @@ |
| 238 | 238 |
} |
| 239 |
|
|
| 239 |
|
|
| 240 | 240 |
return dual_cost == total; |
| ... | ... |
@@ -310,3 +310,3 @@ |
| 310 | 310 |
.run(); |
| 311 |
|
|
| 311 |
|
|
| 312 | 312 |
// Build test digraphs with negative costs |
| ... | ... |
@@ -320,3 +320,3 @@ |
| 320 | 320 |
Node n7 = neg_gr.addNode(); |
| 321 |
|
|
| 321 |
|
|
| 322 | 322 |
Arc a1 = neg_gr.addArc(n1, n2); |
| ... | ... |
@@ -330,3 +330,3 @@ |
| 330 | 330 |
Arc a9 = neg_gr.addArc(n7, n5); |
| 331 |
|
|
| 331 |
|
|
| 332 | 332 |
Digraph::ArcMap<int> neg_c(neg_gr), neg_l1(neg_gr, 0), neg_l2(neg_gr, 0); |
| ... | ... |
@@ -334,9 +334,9 @@ |
| 334 | 334 |
Digraph::NodeMap<int> neg_s(neg_gr, 0); |
| 335 |
|
|
| 335 |
|
|
| 336 | 336 |
neg_l2[a7] = 1000; |
| 337 | 337 |
neg_l2[a8] = -1000; |
| 338 |
|
|
| 338 |
|
|
| 339 | 339 |
neg_s[n1] = 100; |
| 340 | 340 |
neg_s[n4] = -100; |
| 341 |
|
|
| 341 |
|
|
| 342 | 342 |
neg_c[a1] = 100; |
| ... | ... |
@@ -424,3 +424,3 @@ |
| 424 | 424 |
neg_c, neg_s, neg_mcf.UNBOUNDED, false, 0, "#A18"); |
| 425 |
|
|
| 425 |
|
|
| 426 | 426 |
NetworkSimplex<Digraph> negs_mcf(negs_gr); |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -115,3 +115,3 @@ |
| 115 | 115 |
const_preflow_test.minCutMap(cut); |
| 116 |
|
|
| 116 |
|
|
| 117 | 117 |
ignore_unused_variable_warning(fm); |
| ... | ... |
@@ -156,3 +156,3 @@ |
| 156 | 156 |
DIGRAPH_TYPEDEFS(SmartDigraph); |
| 157 |
|
|
| 157 |
|
|
| 158 | 158 |
SmartDigraph g; |
| ... | ... |
@@ -268,3 +268,3 @@ |
| 268 | 268 |
initFlowTest(); |
| 269 |
|
|
| 269 |
|
|
| 270 | 270 |
return 0; |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -82,3 +82,3 @@ |
| 82 | 82 |
typedef concepts::ReadMap<Arc, VType> LengthMap; |
| 83 |
|
|
| 83 |
|
|
| 84 | 84 |
typedef Suurballe<Digraph, LengthMap> SuurballeType; |
| ... | ... |
@@ -106,3 +106,3 @@ |
| 106 | 106 |
suurb_test.findPaths(); |
| 107 |
|
|
| 107 |
|
|
| 108 | 108 |
int f; |
| ... | ... |
@@ -118,3 +118,3 @@ |
| 118 | 118 |
Path<Digraph> p = const_suurb_test.path(k); |
| 119 |
|
|
| 119 |
|
|
| 120 | 120 |
ignore_unused_variable_warning(fm); |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2011 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -90,3 +90,3 @@ |
| 90 | 90 |
if(report) std::cerr << "Run Preflow: " << ti << '\n'; |
| 91 |
if(report) std::cerr << "\nMax flow value: " << pre.flowValue() << '\n'; |
|
| 91 |
if(report) std::cerr << "\nMax flow value: " << pre.flowValue() << '\n'; |
|
| 92 | 92 |
} |
| ... | ... |
@@ -149,3 +149,3 @@ |
| 149 | 149 |
if(report) std::cerr << "\nCardinality of max matching: " |
| 150 |
<< mat.matchingSize() << '\n'; |
|
| 150 |
<< mat.matchingSize() << '\n'; |
|
| 151 | 151 |
} |
| ... | ... |
@@ -167,3 +167,3 @@ |
| 167 | 167 |
} |
| 168 |
|
|
| 168 |
|
|
| 169 | 169 |
switch(desc.type) |
| ... | ... |
@@ -239,3 +239,3 @@ |
| 239 | 239 |
DimacsDescriptor desc = dimacsType(is); |
| 240 |
|
|
| 240 |
|
|
| 241 | 241 |
if(!ap.given("q"))
|
| ... | ... |
@@ -264,3 +264,3 @@ |
| 264 | 264 |
} |
| 265 |
|
|
| 265 |
|
|
| 266 | 266 |
if(ap.given("double"))
|
0 comments (0 inline)