graphprocessing / graph_coarsening

Open Source Graph Coarsening Library
BSD 3-Clause "New" or "Revised" License
5 stars 8 forks source link

Fix hard_matching #80

Closed aobolensk closed 5 years ago

aobolensk commented 5 years ago
TEST(name, name) {
    AL <int> graph = cycle_generator<int>(1);
    Matching matching = hard_matching<int>(graph);
    Matching expected;
    expected.edge_b = {};
    expected.edge_e = {};
    ASSERT_EQ(expected.edge_b, matching.edge_b);
    ASSERT_EQ(expected.edge_e, matching.edge_e);
}

This test generates matching with (0, 0) edge. Edmonds and random_matching return empty matching. Note: In thus case cycle_generator generates graph with duplicated (0, 0) edge.