Component id of node
Fermé
amelmila
Messages postés
7
Statut
Membre
-
crapoulou Messages postés 42848 Date d'inscription Statut Modérateur, Contributeur sécurité Dernière intervention -
crapoulou Messages postés 42848 Date d'inscription Statut Modérateur, Contributeur sécurité Dernière intervention -
I need to get the connected component id of node and it size I am use graphstream I have try this code
HashMap<Node, ConnectedComponent> componentsMap = null;
Graph graph = new DefaultGraph("CC Test");
graph.addNode("A");
graph.addNode("B");
graph.addNode("C");
graph.addNode("D");
graph.addNode("E");
graph.addNode("F");
graph.addEdge("AB", "A", "B");
graph.addEdge("AC", "A", "C");
graph.addEdge("AD", "A", "D");
graph.addEdge("AE", "A", "E");
ConnectedComponents cc = new ConnectedComponents();
cc.init(graph);
cc.setCountAttribute("cc");
cc.compute();
ConnectedComponent get = componentsMap.get(graph.getNode("A"));
System.out.printf(get.id+"ddddddddd\n");
I get this massege
Exception in thread "main" java.lang.NullPointerException
at javaapplication55.CCTest1.main(CCTest1.java:45)
at this line
ConnectedComponent get = componentsMap.get(graph.getNode("A"));
HashMap<Node, ConnectedComponent> componentsMap = null;
Graph graph = new DefaultGraph("CC Test");
graph.addNode("A");
graph.addNode("B");
graph.addNode("C");
graph.addNode("D");
graph.addNode("E");
graph.addNode("F");
graph.addEdge("AB", "A", "B");
graph.addEdge("AC", "A", "C");
graph.addEdge("AD", "A", "D");
graph.addEdge("AE", "A", "E");
ConnectedComponents cc = new ConnectedComponents();
cc.init(graph);
cc.setCountAttribute("cc");
cc.compute();
ConnectedComponent get = componentsMap.get(graph.getNode("A"));
System.out.printf(get.id+"ddddddddd\n");
I get this massege
Exception in thread "main" java.lang.NullPointerException
at javaapplication55.CCTest1.main(CCTest1.java:45)
at this line
ConnectedComponent get = componentsMap.get(graph.getNode("A"));
A voir également:
- Component id of node
- Id telephone - Guide
- Path of exile 2 - Guide
- Https //id.sonyentertainmentnetwork.com/id/management/ ✓ - Forum PS4
- Out of range - Forum Ecran
- Intitle index of ✓ - Forum Téléchargement