fnss.topologies.topology.Topology.neighbors — FNSS 0.1.2 documentation

### Navigation

- index
- modules |
- modules |
- FNSS 0.1.2 documentation »

# fnss.topologies.topology.Topology.neighbors

`Topology.` `neighbors`(n)

  Return a list of the nodes connected to the node n.

  Parameters : | n : node A node in the graph
  Returns : | nlist : list A list of nodes that are adjacent to n.
  Raises : | NetworkXError : If the node n is not in the graph.

  Notes

  It is usually more convenient (and faster) to access the adjacency dictionary as G[n]:

      >>> G = nx.Graph()   # or DiGraph, MultiGraph, MultiDiGraph, etc
      >>> G.add_edge('a','b',weight=7)
      >>> G['a']
      {'b': {'weight': 7}}

  Examples

      >>> G = nx.Graph()   # or DiGraph, MultiGraph, MultiDiGraph, etc
      >>> G.add_path([0,1,2,3])
      >>> G.neighbors(0)
      [1]

### Navigation

- index
- modules |
- modules |
- FNSS 0.1.2 documentation »