COIN-OR::LEMON - Graph Library

Changeset 1423:8c567e298d7f in lemon for test/matching_test.cc


Ignore:
Timestamp:
10/27/18 13:00:48 (2 years ago)
Author:
Balazs Dezso <deba@…>
Branch:
default
Phase:
public
Message:

Paremeter to stop matching calculation when only single node is unmatched

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/matching_test.cc

    r1270 r1423  
    135135  mat_test.startDense();
    136136  mat_test.run();
     137  mat_test.startSparse(false);
     138  mat_test.startDense(false);
     139  mat_test.run(false);
    137140
    138141  const_mat_test.matchingSize();
     
    403406      edgeMap("weight", weight).run();
    404407
     408    int size;
    405409    bool perfect;
    406410    {
     
    408412      mm.run();
    409413      checkMatching(graph, mm);
     414      size = mm.matchingSize();
    410415      perfect = 2 * mm.matchingSize() == countNodes(graph);
     416    }
     417
     418    {
     419      MaxMatching<SmartGraph> mm(graph);
     420      mm.init();
     421      mm.startSparse();
     422      checkMatching(graph, mm);
     423      check(size == mm.matchingSize(), "Inconsistent matching size");
     424    }
     425
     426    {
     427      MaxMatching<SmartGraph> mm(graph);
     428      mm.init();
     429      mm.startDense();
     430      checkMatching(graph, mm);
     431      check(size == mm.matchingSize(), "Inconsistent matching size");
     432    }
     433
     434    {
     435      MaxMatching<SmartGraph> mm(graph);
     436      mm.greedyInit();
     437      mm.startSparse();
     438      checkMatching(graph, mm);
     439      check(size == mm.matchingSize(), "Inconsistent matching size");
     440    }
     441
     442    {
     443      MaxMatching<SmartGraph> mm(graph);
     444      mm.greedyInit();
     445      mm.startDense();
     446      checkMatching(graph, mm);
     447      check(size == mm.matchingSize(), "Inconsistent matching size");
     448    }
     449
     450    {
     451      MaxMatching<SmartGraph> mm(graph);
     452      mm.run(false);
     453      check(size == mm.matchingSize(), "Inconsistent max cardinality matching");
     454    }
     455
     456    {
     457      MaxMatching<SmartGraph> mm(graph);
     458      mm.init();
     459      mm.startSparse(false);
     460      check(size == mm.matchingSize(), "Inconsistent matching size");
     461    }
     462
     463    {
     464      MaxMatching<SmartGraph> mm(graph);
     465      mm.init();
     466      mm.startDense(false);
     467      check(size == mm.matchingSize(), "Inconsistent matching size");
     468    }
     469
     470    {
     471      MaxMatching<SmartGraph> mm(graph);
     472      mm.greedyInit();
     473      mm.startSparse(false);
     474      check(size == mm.matchingSize(), "Inconsistent matching size");
     475    }
     476
     477    {
     478      MaxMatching<SmartGraph> mm(graph);
     479      mm.greedyInit();
     480      mm.startDense(false);
     481      check(size == mm.matchingSize(), "Inconsistent matching size");
    411482    }
    412483
Note: See TracChangeset for help on using the changeset viewer.