Some tips here were extracted from the [[http://cytoscape.org/community.php|cytoscape-discuss]] list. <> == Getting information about neighbors == If you are working with a undirected network, you can use the {{{neighborsList()}}} method from {{{GraphPerspective}}}. For directed networks, you can use {{{GraphPerspective.getAdjacentEdgeIndicesArray}}}. Here an example (as used in the ShortestPathPlugin). First, create some methods to set if your network is directed or not: {{{#!java public void setUndirected() { undirected = true; incoming = true; outcoming = true; } public void setDirected() { undirected = false; incoming = false; outcoming = true; } }}} Then, you can call them from your main code: {{{#!java if (directed) { setDirected(); } else { setUndirected(); } }}} Now, all you need to get the neighbors is: (obs: {{{nodeIndex}}} is the node index of the node you want to find the neighbors) {{{#!java int[] adjEdges = network.getAdjacentEdgeIndicesArray(nodeIndex,undirected,incoming,outcoming); int[] adjNodes = new int[adjEdges.length]; for (int i = 0; i < adjNodes.length; i++) { int node = network.getEdgeSourceIndex(adjEdges[i]); if (node == nodeIndex) node = network.getEdgeTargetIndex(adjEdges[i]); adjNodes[i] = node; } }}} == Getting information about inner nodes in a MetaNode == (from a post from Iliana): For every node in a CyNetwork, there is a method called {{{getGraphPerspective()}}}. This GraphPerspective is the graph inside the node (if any). {{{#!java GraphPerspective insideGraph = metaNode.getGraphPerspective(); if(insideGraph != null){ int numNodes = insideGraph.getNodeCount(); } }}}