COIN-OR::LEMON - Graph Library

Changeset 1117:b40c2bbb8da5 in lemon-main


Ignore:
Timestamp:
08/19/13 22:35:54 (11 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Message:

Fix division by zero error in case of empty graph (#474)

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/network_simplex.h

    r896 r1117  
    930930        _node_id[n] = i;
    931931      }
    932       if (_arc_mixing) {
     932      if (_arc_mixing && _node_num > 1) {
    933933        // Store the arcs in a mixed order
    934934        const int skip = std::max(_arc_num / _node_num, 3);
  • test/min_cost_flow_test.cc

    r877 r1117  
    396396  checkMcf(mcf3, mcf3.run(param), neg2_gr, neg2_l, neg2_u, neg2_c, neg2_s,
    397397           mcf3.OPTIMAL, true,     -300, test_str + "-18", GEQ);
     398
     399  // Tests for empty graph
     400  Digraph gr0;
     401  MCF mcf0(gr0);
     402  mcf0.run(param);
     403  check(mcf0.totalCost() == 0, "Wrong total cost"); 
    398404}
    399405
Note: See TracChangeset for help on using the changeset viewer.