# Changeset 592:e72bacfea6b7 in lemon

Ignore:
Timestamp:
02/25/09 12:10:57 (10 years ago)
Branch:
default
Phase:
public
Message:

Remane GomoryHuTree? to GomoryHu? (#66)

Files:
2 edited
1 moved

Unmodified
Removed
• ## lemon/Makefile.am

 r590 lemon/full_graph.h \ lemon/glpk.h \ lemon/gomory_hu_tree.h \ lemon/gomory_hu.h \ lemon/graph_to_eps.h \ lemon/grid_graph.h \
• ## lemon/gomory_hu.h

 r591 typename CAP = typename GR::template EdgeMap > class GomoryHuTree { class GomoryHu { public: /// \param graph The graph the algorithm will run on. /// \param capacity The capacity map. GomoryHuTree(const Graph& graph, const Capacity& capacity) GomoryHu(const Graph& graph, const Capacity& capacity) : _graph(graph), _capacity(capacity), _pred(0), _weight(0), _order(0) /// /// Destructor ~GomoryHuTree() { ~GomoryHu() { destroyStructures(); } /// This iterator class lists the nodes of a minimum cut found by /// GomoryHuTree. Before using it, you must allocate a GomoryHuTree class, /// and call its \ref GomoryHuTree::run() "run()" method. /// GomoryHu. Before using it, you must allocate a GomoryHu class, /// and call its \ref GomoryHu::run() "run()" method. /// /// This example counts the nodes in the minimum cut separating \c s from /// \c t. /// \code /// GomoruHuTree gom(g, capacities); /// GomoruHu gom(g, capacities); /// gom.run(); /// int sum=0; /// for(GomoruHuTree::MinCutNodeIt n(gom,s,t);n!=INVALID;++n) ++sum; /// for(GomoruHu::MinCutNodeIt n(gom,s,t);n!=INVALID;++n) ++sum; /// \endcode class MinCutNodeIt /// Constructor /// MinCutNodeIt(GomoryHuTree const &gomory, ///< The GomoryHuTree class. You must call its MinCutNodeIt(GomoryHu const &gomory, ///< The GomoryHu class. You must call its ///  run() method ///  before initializing this iterator /// This iterator class lists the edges of a minimum cut found by /// GomoryHuTree. Before using it, you must allocate a GomoryHuTree class, /// and call its \ref GomoryHuTree::run() "run()" method. /// GomoryHu. Before using it, you must allocate a GomoryHu class, /// and call its \ref GomoryHu::run() "run()" method. /// /// This example computes the value of the minimum cut separating \c s from /// \c t. /// \code /// GomoruHuTree gom(g, capacities); /// GomoruHu gom(g, capacities); /// gom.run(); /// int value=0; /// for(GomoruHuTree::MinCutEdgeIt e(gom,s,t);e!=INVALID;++e) /// for(GomoruHu::MinCutEdgeIt e(gom,s,t);e!=INVALID;++e) ///   value+=capacities[e]; /// \endcode /// the result will be the same as it is returned by /// \ref GomoryHuTree::minCostValue() "gom.minCostValue(s,t)" /// \ref GomoryHu::minCostValue() "gom.minCostValue(s,t)" class MinCutEdgeIt { public: MinCutEdgeIt(GomoryHuTree const &gomory, ///< The GomoryHuTree class. You must call its MinCutEdgeIt(GomoryHu const &gomory, ///< The GomoryHu class. You must call its ///  run() method ///  before initializing this iterator
• ## test/gomory_hu_test.cc

 r591 #include #include #include #include #include edgeMap("capacity", capacity).run(); GomoryHuTree ght(graph, capacity); GomoryHu ght(graph, capacity); ght.init(); ght.run(); int sum=0; for(GomoryHuTree::MinCutEdgeIt a(ght, u, v);a!=INVALID;++a) for(GomoryHu::MinCutEdgeIt a(ght, u, v);a!=INVALID;++a) sum+=capacity[a]; check(sum == ght.minCutValue(u, v), "Problem with MinCutEdgeIt"); sum=0; for(GomoryHuTree::MinCutNodeIt n(ght, u, v,true);n!=INVALID;++n) for(GomoryHu::MinCutNodeIt n(ght, u, v,true);n!=INVALID;++n) sum++; for(GomoryHuTree::MinCutNodeIt n(ght, u, v,false);n!=INVALID;++n) for(GomoryHu::MinCutNodeIt n(ght, u, v,false);n!=INVALID;++n) sum++; check(sum == countNodes(graph), "Problem with MinCutNodeIt");
Note: See TracChangeset for help on using the changeset viewer.