Class UndirectedOrderedSparseMultigraph<V,​E>

    • Constructor Detail

      • UndirectedOrderedSparseMultigraph

        public UndirectedOrderedSparseMultigraph()
        Creates a new instance.
    • Method Detail

      • getFactory

        public static <V,​E> com.google.common.base.Supplier<UndirectedGraph<V,​E>> getFactory()
        Type Parameters:
        V - the vertex type for the graph Supplier
        E - the edge type for the graph Supplier
        Returns:
        a Supplier that creates an instance of this graph type.
      • addVertex

        public boolean addVertex​(V vertex)
        Description copied from interface: Hypergraph
        Adds vertex to this graph. Fails if vertex is null or already in the graph.
        Specified by:
        addVertex in interface Hypergraph<V,​E>
        Overrides:
        addVertex in class UndirectedSparseMultigraph<V,​E>
        Parameters:
        vertex - the vertex to add
        Returns:
        true if the add is successful, and false otherwise
      • getNeighbors

        public java.util.Collection<V> getNeighbors​(V vertex)
        Description copied from interface: Hypergraph
        Returns the collection of vertices which are connected to vertex via any edges in this graph. If vertex is connected to itself with a self-loop, then it will be included in the collection returned.
        Specified by:
        getNeighbors in interface Hypergraph<V,​E>
        Overrides:
        getNeighbors in class UndirectedSparseMultigraph<V,​E>
        Parameters:
        vertex - the vertex whose neighbors are to be returned
        Returns:
        the collection of vertices which are connected to vertex, or null if vertex is not present