COIN-OR::LEMON - Graph Library

Ticket #66: 926295286bdb.patch

File 926295286bdb.patch, 1.9 KB (added by Balazs Dezso, 16 years ago)

Fixes

  • lemon/gomory_hu_tree.h

    # HG changeset patch
    # User Balazs Dezso <deba@inf.elte.hu>
    # Date 1235243941 -3600
    # Node ID 926295286bdb51ee3cb4c9937296a0d5a728fdfa
    # Parent  33085d6328e470d6ad8cc11f1616bebb4f08066c
    Add missing header to gomory_hu_tree.h header and fix test (ticket #66)
    
    diff -r 33085d6328e4 -r 926295286bdb lemon/gomory_hu_tree.h
    a b  
    1919#ifndef LEMON_GOMORY_HU_TREE_H
    2020#define LEMON_GOMORY_HU_TREE_H
    2121
     22#include <limits>
     23
    2224#include <lemon/preflow.h>
    2325#include <lemon/concept_check.h>
    2426#include <lemon/concepts/maps.h>
  • test/Makefile.am

    diff -r 33085d6328e4 -r 926295286bdb test/Makefile.am
    a b  
    1616        test/dim_test \
    1717        test/edge_set_test \
    1818        test/error_test \
     19        test/gomory_hu_test \
    1920        test/graph_copy_test \
    2021        test/graph_test \
    2122        test/graph_utils_test \
  • test/gomory_hu_test.cc

    diff -r 33085d6328e4 -r 926295286bdb test/gomory_hu_test.cc
    a b  
    2424  "3\n"
    2525  "4\n"
    2626  "@arcs\n"
    27   "     label length\n"
     27  "     label capacity\n"
    2828  "0 1  0     1\n"
    2929  "1 2  1     1\n"
    3030  "2 3  2     1\n"
     
    4848    Node s = graph.u(e);
    4949    Node t = graph.v(e);
    5050
    51     if (cut[s] && !cut[t]) {
     51    if (cut[s] != cut[t]) {
    5252      sum += capacity[e];
    5353    }
    5454  }
     
    5656}
    5757
    5858
    59 int main(int argc, const char *argv[]) {
     59int main() {
    6060  Graph graph;
    6161  IntEdgeMap capacity(graph);
    6262
     
    6868  ght.init();
    6969  ght.run();
    7070
    71 
    72   int cnt = 0;
    73   std::cerr << countNodes(graph) << std::endl;
    7471  for (NodeIt u(graph); u != INVALID; ++u) {
    75     std::cerr << ++cnt << std::endl;
    76     int bcnt = 0;
    7772    for (NodeIt v(graph); v != u; ++v) {
    7873      Preflow<Graph, IntEdgeMap> pf(graph, capacity, u, v);
    7974      pf.runMinCut();