test_class.file: singa-mathematics/src/test/java/bio/singa/mathematics/algorithms/graphs/DisconnectedSubgraphFinderTest.java
test_class.identifier: DisconnectedSubgraphFinderTest
test_case.body: @Test
      void shouldFindSubgraphs() {
          UndirectedGraph graph = Graphs.buildCircularGraph(20);
          graph.removeNode(5);
          graph.removeNode(16);
  
          List<UndirectedGraph> disconnectedSubgraphs = DisconnectedSubgraphFinder.findDisconnectedSubgraphs(graph);
          assertEquals(2, disconnectedSubgraphs.size());
  
          UndirectedGraph first = disconnectedSubgraphs.get(0);
          assertEquals(8, first.getNodes().size());
  
          UndirectedGraph second = disconnectedSubgraphs.get(1);
          assertEquals(10, second.getNodes().size());
      }
test_case.class_method_signature: DisconnectedSubgraphFinderTest.shouldFindSubgraphs()
test_case.full_signature: @Test void shouldFindSubgraphs()
test_case.identifier: shouldFindSubgraphs
test_case.invocations: buildCircularGraph removeNode removeNode findDisconnectedSubgraphs assertEquals size get assertEquals size getNodes get assertEquals size getNodes
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldFindSubgraphs()
focal_class.declarator: queue
focal_class.modifier: private final
focal_class.original_string: private final Queue<NodeType> queue;
focal_class.type: Queue<NodeType>
focal_class.var_name: queue
focal_class.declarator: graph
focal_class.modifier: private final
focal_class.original_string: private final GraphType graph;
focal_class.type: GraphType
focal_class.var_name: graph
focal_class.declarator: unprocessedNodes
focal_class.modifier: private final
focal_class.original_string: private final Collection<NodeType> unprocessedNodes;
focal_class.type: Collection<NodeType>
focal_class.var_name: unprocessedNodes
focal_class.declarator: nodesOfSubgraphs
focal_class.modifier: private final
focal_class.original_string: private final List<List<NodeType>> nodesOfSubgraphs;
focal_class.type: List<List<NodeType>>
focal_class.var_name: nodesOfSubgraphs
focal_class.declarator: edgesOfSubgraphs
focal_class.modifier: private final
focal_class.original_string: private final List<List<EdgeType>> edgesOfSubgraphs;
focal_class.type: List<List<EdgeType>>
focal_class.var_name: edgesOfSubgraphs
focal_class.declarator: currentNodes
focal_class.modifier: private
focal_class.original_string: private ArrayList<NodeType> currentNodes;
focal_class.type: ArrayList<NodeType>
focal_class.var_name: currentNodes
focal_class.file: singa-mathematics/src/main/java/bio/singa/mathematics/algorithms/graphs/DisconnectedSubgraphFinder.java
focal_class.identifier: DisconnectedSubgraphFinder
focal_class.class_method_signature: DisconnectedSubgraphFinder.DisconnectedSubgraphFinder(GraphType graph)
focal_class.full_signature: private  DisconnectedSubgraphFinder(GraphType graph)
focal_class.identifier: DisconnectedSubgraphFinder
focal_class.modifiers: private
focal_class.parameters: (GraphType graph)
focal_class.signature:  DisconnectedSubgraphFinder(GraphType graph)
focal_class.class_method_signature: DisconnectedSubgraphFinder.findDisconnectedSubgraphs(GraphType graph)
focal_class.full_signature: public static List<GraphType> findDisconnectedSubgraphs(GraphType graph)
focal_class.identifier: findDisconnectedSubgraphs
focal_class.modifiers: public static
focal_class.parameters: (GraphType graph)
focal_class.return: List<GraphType>
focal_class.signature: List<GraphType> findDisconnectedSubgraphs(GraphType graph)
focal_class.class_method_signature: DisconnectedSubgraphFinder.getNextSubgraphOrigin()
focal_class.full_signature: private Optional<NodeType> getNextSubgraphOrigin()
focal_class.identifier: getNextSubgraphOrigin
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Optional<NodeType>
focal_class.signature: Optional<NodeType> getNextSubgraphOrigin()
focal_class.class_method_signature: DisconnectedSubgraphFinder.processSubgraph(NodeType initialNode)
focal_class.full_signature: private void processSubgraph(NodeType initialNode)
focal_class.identifier: processSubgraph
focal_class.modifiers: private
focal_class.parameters: (NodeType initialNode)
focal_class.return: void
focal_class.signature: void processSubgraph(NodeType initialNode)
focal_class.class_method_signature: DisconnectedSubgraphFinder.processNode(NodeType node)
focal_class.full_signature: private void processNode(NodeType node)
focal_class.identifier: processNode
focal_class.modifiers: private
focal_class.parameters: (NodeType node)
focal_class.return: void
focal_class.signature: void processNode(NodeType node)
focal_class.class_method_signature: DisconnectedSubgraphFinder.createSubgraphs()
focal_class.full_signature: private List<GraphType> createSubgraphs()
focal_class.identifier: createSubgraphs
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: List<GraphType>
focal_class.signature: List<GraphType> createSubgraphs()
focal_method.body: public static <NodeType extends Node<NodeType, VectorType, IdentifierType>,
              EdgeType extends Edge<NodeType>, VectorType extends Vector, IdentifierType,
              GraphType extends Graph<NodeType, EdgeType, IdentifierType>> List<GraphType> findDisconnectedSubgraphs(GraphType graph) {
          // create new instance for the given graph
          DisconnectedSubgraphFinder<NodeType, EdgeType, VectorType, IdentifierType, GraphType> finder = new DisconnectedSubgraphFinder<>(graph);
          // while not every node has been assigned to a subgraph
          Optional<NodeType> nextSubgraphOrigin;
          while ((nextSubgraphOrigin = finder.getNextSubgraphOrigin()).isPresent()) {
              // use origin node to determine surrounding subgraph
              finder.processSubgraph(nextSubgraphOrigin.get());
          }
          // return the assembled subgraphs
          return finder.createSubgraphs();
      }
focal_method.class_method_signature: DisconnectedSubgraphFinder.findDisconnectedSubgraphs(GraphType graph)
focal_method.full_signature: public static List<GraphType> findDisconnectedSubgraphs(GraphType graph)
focal_method.identifier: findDisconnectedSubgraphs
focal_method.invocations: isPresent getNextSubgraphOrigin processSubgraph get createSubgraphs
focal_method.modifiers: public static
focal_method.parameters: (GraphType graph)
focal_method.return: List<GraphType>
focal_method.signature: List<GraphType> findDisconnectedSubgraphs(GraphType graph)