Class SimpleEdge<V>

    • Constructor Detail

      • SimpleEdge

        public SimpleEdge​(V v1,
                          V v2,
                          double cost)
        Construct a simple edge.
        Parameters:
        v1 - a vertex
        v2 - a vertex
        cost - the edge cost
      • SimpleEdge

        public SimpleEdge​(V v1,
                          V v2)
        Construct a simple edge.
        Parameters:
        v1 - a vertex
        v2 - a vertex
    • Method Detail

      • cost

        public double cost()
        Description copied from interface: WeightedEdge
        Gets the cost or weight of this edge.
        Specified by:
        cost in interface WeightedEdge<V>
        Returns:
        the edge cost
      • vertices

        public Set<V> vertices()
        Description copied from interface: HyperEdge
        Gets the set of vertices associated with the edge.
        Specified by:
        vertices in interface HyperEdge<V>
        Returns:
        the set of vertices
      • neighbors

        public Set<V> neighbors​(V vertex)
        Description copied from interface: HyperEdge
        Gets the set of neighboring vertices connected to vertex.
        Specified by:
        neighbors in interface HyperEdge<V>
        Parameters:
        vertex - a vertex
        Returns:
        the set of vertices connected to vertex
      • neighbor

        public V neighbor​(V vertex)
        Get the unique neighboring vertex connected to vertex. It may be the same as vertex to account for self loop.
        Specified by:
        neighbor in interface Edge<V>
        Parameters:
        vertex - a vertex
        Returns:
        the unique neighboring vertex; null if vertex is not in the edge