BiconnectedComponents { public List<List<Edge>> components() { return Collections.unmodifiableList(components); } BiconnectedComponents(Graph g);   BiconnectedComponents(Graph g, boolean storeComponents); List<List<Edge>> components(); boolean connected();  }
@Test public void benzene() throws Exception { Graph g = Graph.fromSmiles("c1ccccc1"); BiconnectedComponents bc = new BiconnectedComponents(g); assertThat(bc.components().size(), is(1)); assertThat(bc.components().get(0).size(), is(6)); }
@Test public void spiro() throws Exception { Graph g = Graph.fromSmiles("C1CCCCC11CCCCC1"); BiconnectedComponents bc = new BiconnectedComponents(g); assertThat(bc.components().size(), is(2)); assertThat(bc.components().get(0).size(), is(6)); assertThat(bc.components().get(0).size(), is(6)); }
@Test public void fused() throws Exception { Graph g = Graph.fromSmiles("C1=CC2=CC=CC=C2C=C1"); BiconnectedComponents bc = new BiconnectedComponents(g); assertThat(bc.components().size(), is(1)); assertThat(bc.components().get(0).size(), is(11)); }
@Test public void bridged() throws Exception { Graph g = Graph.fromSmiles("C1CC2CCC1C2"); BiconnectedComponents bc = new BiconnectedComponents(g); assertThat(bc.components().size(), is(1)); assertThat(bc.components().get(0).size(), is(8)); }
@Test public void exocyclic() throws Exception { Graph g = Graph.fromSmiles("[AsH]=C1C=CC=CC=C1"); BiconnectedComponents bc = new BiconnectedComponents(g); assertThat(bc.components().size(), is(1)); assertThat(bc.components().get(0).size(), is(7)); }