for (Node n : graph.getNodeSet()) { if (connectedComponentsMap.get(n) == maxIndex) { giant.add(n);
/** * Compute an iteration of the algorithm for all the nodes of the network. * * @complexity N times the complexity of the computeNode() function, where N * is the number of nodes in the network. */ // @Override public void compute() { /* * This simply calls the computeNode method for all nodes in the graph. * Nodes are processed in a random order. Computation only occurs if the * graph has changed since last call */ if (graphChanged) { ArrayList<Node> nodeSet = new ArrayList<Node>(graph.getNodeSet()); Collections.shuffle(nodeSet, rng); for (Node node : nodeSet) { computeNode(node); updateDisplayClass(node); } graphChanged = staticMode; } }
/** * Compute an iteration of the algorithm for all the nodes of the network. * * @complexity N times the complexity of the computeNode() function, where N * is the number of nodes in the network. */ // @Override public void compute() { /* * This simply calls the computeNode method for all nodes in the graph. * Nodes are processed in a random order. Computation only occurs if the * graph has changed since last call */ if (graphChanged) { ArrayList<Node> nodeSet = new ArrayList<Node>(graph.getNodeSet()); Collections.shuffle(nodeSet, rng); for (Node node : nodeSet) { computeNode(node); updateDisplayClass(node); } graphChanged = staticMode; } }
GEXFAttributeMap(String type, Graph g) { this.type = type; Iterable<? extends Element> iterable; if (type.equals("node")) iterable = (Iterable<? extends Element>) g.getNodeSet(); else iterable = (Iterable<? extends Element>) g.getEdgeSet(); for (Element e : iterable) { for (String key : e.getAttributeKeySet()) { Object value = e.getAttribute(key); check(key, value); } } }
GEXFAttributeMap(String type, Graph g) { this.type = type; Iterable<? extends Element> iterable; if (type.equals("node")) iterable = (Iterable<? extends Element>) g.getNodeSet(); else iterable = (Iterable<? extends Element>) g.getEdgeSet(); for (Element e : iterable) { for (String key : e.getAttributeKeySet()) { Object value = e.getAttribute(key); check(key, value); } } }
return g.getNodeSet().toArray(new Node[g.getNodeCount()]);
return g.getNodeSet().toArray(new Node[g.getNodeCount()]);