Class SimpleArc<V>

    • Constructor Detail

      • SimpleArc

        public SimpleArc​(V head,
                         V tail,
                         double cost)
        Construct a simple arc.
        Parameters:
        head - head vertex
        tail - tail vertex
        cost - the edge cost
      • SimpleArc

        public SimpleArc​(V head,
                         V tail)
        Construct a simple arc.
        Parameters:
        head - head vertex
        tail - tail 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
      • head

        public V head()
        Specified by:
        head in interface Arc<V>
      • tail

        public V tail()
        Description copied from interface: Arc
        Get the tail of this arc.
        Specified by:
        tail in interface Arc<V>
        Returns:
        the tail
      • neighbor

        public V neighbor​(V vertex)
        Description copied from interface: Edge
        Gets the neighboring vertex connected to vertex.
        Specified by:
        neighbor in interface Edge<V>
        Parameters:
        vertex - a vertex
        Returns:
        the neighboring vertex
      • 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
      • 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