- Add the Codota plugin to your IDE and get smart completions

private void myMethod () {DateTime d =

- new DateTime()
- DateTimeFormatter formatter;String text;formatter.parseDateTime(text)
- Object instant;new DateTime(instant)
- Smart code suggestions by Tabnine
}

/** Check whether the graph is connected, that is, if it is possible to connect every node to each other, but only in a subset of vertices (subgraph). * * @param graph The graph to analyze * @param vertices Subset of vertices * @return {@code true} if the subgraph is connected, and false otherwise */ public static boolean isConnected(org.jgrapht.Graph graph, SortedSet vertices) { Subgraph subgraph; if (graph instanceof DirectedGraph) subgraph = new DirectedSubgraph((DirectedGraph) graph, vertices, null); else if (graph instanceof UndirectedGraph) subgraph = new UndirectedSubgraph((UndirectedGraph) graph, vertices, null); else throw new RuntimeException("Bad"); return isConnected(subgraph); }

protected void calculateDensestSubgraph() { UndirectedSubgraph<V,E> currentSubGraph = new UndirectedSubgraph<V,E>(graph, graph.vertexSet(), null); double bestDensity = calculateDensity(graph); while (currentSubGraph.vertexSet().size() > 0) { currentSubGraph = new UndirectedSubgraph<V,E>(graph, currentSubGraph.vertexSet(), null); currentSubGraph.removeVertex(getMinDegreeVertex(currentSubGraph)); double density = calculateDensity(currentSubGraph); if (density > bestDensity) { bestDensity = density; bestSubGraph = currentSubGraph; } } }