Class SccVertexValue

  • All Implemented Interfaces:
    org.apache.hadoop.io.Writable

    public class SccVertexValue
    extends Object
    implements org.apache.hadoop.io.Writable
    Vertex value for the Strongly Connected Components algorithm. It keeps track of the parents of the vertex in order to traverse the graph backwards.
    • Constructor Detail

      • SccVertexValue

        public SccVertexValue()
        Public constructor required for serialization.
      • SccVertexValue

        public SccVertexValue​(long value)
        Constructor
        Parameters:
        value - Initial value for this vertex.
    • Method Detail

      • readFields

        public void readFields​(DataInput in)
                        throws IOException
        Specified by:
        readFields in interface org.apache.hadoop.io.Writable
        Throws:
        IOException
      • getParents

        public ArrayList<Long> getParents()
        Returns the list of parent vertices, i.e., vertices that are at the other end of incoming edges. If the vertex doesn't have any incoming edge, it returns null.
        Returns:
        List of the vertex's parents.
      • addParent

        public void addParent​(long vertexId)
        Adds a vertex id to the list of parent vertices.
        Parameters:
        vertexId - It of the parent vertex.
      • clearParents

        public void clearParents()
        Clear parents list.
      • set

        public void set​(long value)
        Sets the vertex value. At the end of the SCC computation, vertices with the same vertex value are part of the same component.
        Parameters:
        value - Vertex value.
      • get

        public long get()
        Returns the vertex value. At the end of the SCC computation, vertices with the same vertex value are part of the same component.
        Returns:
        Current vertex value.
      • deactivate

        public void deactivate()
        Remove this vertex from the computation.
      • isActive

        public boolean isActive()
        Indicates whether the vertex was removed in a Trimming phase.
        Returns:
        True if the vertex was trimmed, otherwise, return false.