Interface Neighbors


  • public interface Neighbors
    Utilities for extracting neighborhood graphs and iterating over them.
    • Method Summary

      Static Methods 
      Modifier and Type Method Description
      static <V,​E>
      org.jgrapht.Graph<V,​E>
      neighborhoodGraph​(org.jgrapht.Graph<V,​E> graph, V node)
      Create an iterator over the neighbors of the given node.
      static <V,​E>
      Iterator<V>
      neighborIterator​(org.jgrapht.Graph<V,​E> graph, V node)
      Create an iterator over the neighbors of the given node.
      static <V,​E>
      Set<V>
      neighborSetOf​(org.jgrapht.Graph<V,​E> graph, V node)
      Extract the neighbors of the given node.
    • Method Detail

      • neighborIterator

        static <V,​E> Iterator<V> neighborIterator​(org.jgrapht.Graph<V,​E> graph,
                                                        V node)
        Create an iterator over the neighbors of the given node.
        Type Parameters:
        V - the type of nodes in the graph
        E - the type of edges in the graph
        Parameters:
        graph - the graph
        node - the target node
        Returns:
        an iterator
      • neighborSetOf

        static <V,​E> Set<V> neighborSetOf​(org.jgrapht.Graph<V,​E> graph,
                                                V node)
        Extract the neighbors of the given node.
        Type Parameters:
        V - the type of nodes in the graph
        E - the type of edges in the graph
        Parameters:
        graph - the graph
        node - the target node
        Returns:
        a set
      • neighborhoodGraph

        static <V,​E> org.jgrapht.Graph<V,​E> neighborhoodGraph​(org.jgrapht.Graph<V,​E> graph,
                                                                          V node)
        Create an iterator over the neighbors of the given node.
        Type Parameters:
        V - the type of nodes in the graph
        E - the type of edges in the graph
        Parameters:
        graph - the graph
        node - the target node
        Returns:
        a neighborhood of node