[Lemon-commits] [lemon_svn] alpar: r1207 - in hugo/trunk/src: hugo test
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:43:52 CET 2006
Author: alpar
Date: Wed Sep 22 11:55:41 2004
New Revision: 1207
Added:
hugo/trunk/src/hugo/min_cost_flow.h
- copied, changed from r1205, /hugo/trunk/src/hugo/min_cost_flows.h
hugo/trunk/src/hugo/suurballe.h
- copied, changed from r1205, /hugo/trunk/src/hugo/min_length_paths.h
hugo/trunk/src/test/min_cost_flow_test.cc
- copied, changed from r1205, /hugo/trunk/src/test/min_cost_flows_test.cc
hugo/trunk/src/test/suurballe_test.cc
- copied, changed from r1205, /hugo/trunk/src/test/min_length_paths_test.cc
Removed:
hugo/trunk/src/hugo/min_cost_flows.h
hugo/trunk/src/hugo/min_length_paths.h
hugo/trunk/src/test/min_cost_flows_test.cc
hugo/trunk/src/test/min_length_paths_test.cc
Modified:
hugo/trunk/src/hugo/Makefile.am
hugo/trunk/src/test/Makefile.am
Log:
Classes (and corresponting file names) renamed:
- MinLengthPaths -> Suurballe
- MinCostFlows -> MinCostFlow
Modified: hugo/trunk/src/hugo/Makefile.am
==============================================================================
--- hugo/trunk/src/hugo/Makefile.am (original)
+++ hugo/trunk/src/hugo/Makefile.am Wed Sep 22 11:55:41 2004
@@ -18,8 +18,8 @@
map_registry.h \
map_bits.h \
maps.h \
- min_cost_flows.h \
- min_length_paths.h \
+ min_cost_flow.h \
+ suurballe.h \
preflow.h \
path.h \
smart_graph.h \
Copied: hugo/trunk/src/hugo/min_cost_flow.h (from r1205, /hugo/trunk/src/hugo/min_cost_flows.h)
==============================================================================
--- /hugo/trunk/src/hugo/min_cost_flows.h (original)
+++ hugo/trunk/src/hugo/min_cost_flow.h Wed Sep 22 11:55:41 2004
@@ -21,7 +21,7 @@
///(for small values of \c k) having minimal total cost between 2 nodes
///
///
- /// The class \ref hugo::MinCostFlows "MinCostFlows" implements
+ /// The class \ref hugo::MinCostFlow "MinCostFlow" implements
/// an algorithm for finding a flow of value \c k
/// having minimal total cost
/// from a given source node to a given target node in an
@@ -42,7 +42,7 @@
///
///\author Attila Bernath
template <typename Graph, typename LengthMap, typename CapacityMap>
- class MinCostFlows {
+ class MinCostFlow {
typedef typename LengthMap::ValueType Length;
@@ -108,7 +108,7 @@
///\param _G The directed graph the algorithm runs on.
///\param _length The length (weight or cost) of the edges.
///\param _cap The capacity of the edges.
- MinCostFlows(Graph& _G, LengthMap& _length, CapacityMap& _cap) : G(_G),
+ MinCostFlow(Graph& _G, LengthMap& _length, CapacityMap& _cap) : G(_G),
length(_length), capacity(_cap), flow(_G), potential(_G){ }
@@ -232,7 +232,7 @@
}
- }; //class MinCostFlows
+ }; //class MinCostFlow
///@}
Copied: hugo/trunk/src/hugo/suurballe.h (from r1205, /hugo/trunk/src/hugo/min_length_paths.h)
==============================================================================
--- /hugo/trunk/src/hugo/min_length_paths.h (original)
+++ hugo/trunk/src/hugo/suurballe.h Wed Sep 22 11:55:41 2004
@@ -9,7 +9,7 @@
#include <hugo/maps.h>
#include <vector>
-#include <hugo/min_cost_flows.h>
+#include <hugo/min_cost_flow.h>
namespace hugo {
@@ -19,7 +19,7 @@
///\brief Implementation of an algorithm for finding k edge-disjoint paths between 2 nodes
/// of minimal total length
///
- /// The class \ref hugo::MinLengthPaths implements
+ /// The class \ref hugo::Suurballe implements
/// an algorithm for finding k edge-disjoint paths
/// from a given source node to a given target node in an
/// edge-weighted directed graph having minimal total weight (length).
@@ -29,9 +29,18 @@
///\param Graph The directed graph type the algorithm runs on.
///\param LengthMap The type of the length map (values should be nonnegative).
///
+ ///\note It it questionable if it is correct to call this method after
+ ///%Suurballe for it is just a special case of Edmond's and Karp's algorithm
+ ///for finding minimum cost flows. In fact, this implementation is just
+ ///wraps the MinCostFlow algorithms. The paper of both %Suurballe and
+ ///Edmonds-Karp published in 1972, therefore it is possibly right to
+ ///state that they are
+ ///independent results. Most frequently this special case is referred as
+ ///%Suurballe method in the literature, especially in communication
+ ///network context.
///\author Attila Bernath
template <typename Graph, typename LengthMap>
- class MinLengthPaths{
+ class Suurballe{
typedef typename LengthMap::ValueType Length;
@@ -50,8 +59,8 @@
//Auxiliary variables
//This is the capacity map for the mincostflow problem
ConstMap const1map;
- //This MinCostFlows instance will actually solve the problem
- MinCostFlows<Graph, LengthMap, ConstMap> mincost_flow;
+ //This MinCostFlow instance will actually solve the problem
+ MinCostFlow<Graph, LengthMap, ConstMap> mincost_flow;
//Container to store found paths
std::vector< std::vector<Edge> > paths;
@@ -63,7 +72,7 @@
///\param _G The directed graph the algorithm runs on.
///\param _length The length (weight or cost) of the edges.
- MinLengthPaths(Graph& _G, LengthMap& _length) : G(_G),
+ Suurballe(Graph& _G, LengthMap& _length) : G(_G),
const1map(1), mincost_flow(_G, _length, const1map){}
///Runs the algorithm.
@@ -182,7 +191,7 @@
B.commit();
}
- }; //class MinLengthPaths
+ }; //class Suurballe
///@}
Modified: hugo/trunk/src/test/Makefile.am
==============================================================================
--- hugo/trunk/src/test/Makefile.am (original)
+++ hugo/trunk/src/test/Makefile.am Wed Sep 22 11:55:41 2004
@@ -11,8 +11,8 @@
graph_test \
graph_wrapper_test \
kruskal_test \
- min_cost_flows_test \
- min_length_paths_test \
+ min_cost_flow_test \
+ suurballe_test \
path_test \
preflow_test \
test_tools_fail \
@@ -30,8 +30,8 @@
graph_test_SOURCES = graph_test.cc
graph_wrapper_test_SOURCES = graph_wrapper_test.cc
kruskal_test_SOURCES = kruskal_test.cc
-min_cost_flows_test_SOURCES = min_cost_flows_test.cc
-min_length_paths_test_SOURCES = min_length_paths_test.cc
+min_cost_flow_test_SOURCES = min_cost_flow_test.cc
+suurballe_test_SOURCES = suurballe_test.cc
path_test_SOURCES = path_test.cc
preflow_test_SOURCES = preflow_test.cc
time_measure_test_SOURCES = time_measure_test.cc
Copied: hugo/trunk/src/test/min_cost_flow_test.cc (from r1205, /hugo/trunk/src/test/min_cost_flows_test.cc)
==============================================================================
--- /hugo/trunk/src/test/min_cost_flows_test.cc (original)
+++ hugo/trunk/src/test/min_cost_flow_test.cc Wed Sep 22 11:55:41 2004
@@ -1,7 +1,7 @@
#include <iostream>
#include "test_tools.h"
#include <hugo/list_graph.h>
-#include <hugo/min_cost_flows.h>
+#include <hugo/min_cost_flow.h>
//#include <path.h>
//#include <maps.h>
@@ -76,7 +76,7 @@
// ConstMap<Edge, int> const1map(1);
std::cout << "Mincostflows algorithm test..." << std::endl;
- MinCostFlows< ListGraph, ListGraph::EdgeMap<int>, ListGraph::EdgeMap<int> >
+ MinCostFlow< ListGraph, ListGraph::EdgeMap<int>, ListGraph::EdgeMap<int> >
surb_test(graph, length, capacity);
int k=1;
Copied: hugo/trunk/src/test/suurballe_test.cc (from r1205, /hugo/trunk/src/test/min_length_paths_test.cc)
==============================================================================
--- /hugo/trunk/src/test/min_length_paths_test.cc (original)
+++ hugo/trunk/src/test/suurballe_test.cc Wed Sep 22 11:55:41 2004
@@ -1,6 +1,6 @@
#include <iostream>
#include <hugo/list_graph.h>
-#include <hugo/min_length_paths.h>
+#include <hugo/suurballe.h>
//#include <path.h>
#include "test_tools.h"
@@ -55,7 +55,7 @@
int k=3;
- MinLengthPaths< ListGraph, ListGraph::EdgeMap<int> >
+ Suurballe< ListGraph, ListGraph::EdgeMap<int> >
surb_test(graph, length);
check( surb_test.run(s,t,k) == 2 && surb_test.totalLength() == 46,
More information about the Lemon-commits
mailing list