MaximumMatching { static Matching maximal(Graph g) { Matching m = Matching.empty(g); maximise(g, m, 0); return m; } private  MaximumMatching(Graph graph, Matching matching, int nMatched, IntSet subset);   }
@Test public void simple_maximal() throws Exception { Graph g = Graph.fromSmiles("cccc"); Matching m = MaximumMatching.maximal(g); assertThat(m.matches(), hasItems(Tuple.of(0, 1), Tuple.of(2, 3))); }
@Test public void quinone() throws Exception { Graph g = Graph.fromSmiles("oc1ccc(o)cc1"); Matching m = MaximumMatching.maximal(g); assertThat(m.matches(), hasItems(Tuple.of(0, 1), Tuple.of(2, 3), Tuple.of(4, 5), Tuple.of(6, 7))); }
@Test public void azulene() throws Exception { Graph g = Graph.fromSmiles("C1CC2CCCCCC2C1"); Matching m = MaximumMatching.maximal(g); assertThat(m.matches(), hasItems(Tuple.of(0, 1), Tuple.of(2, 3), Tuple.of(4, 5), Tuple.of(6, 7), Tuple.of(8, 9))); }