Interface CoresAlgo


  • public interface CoresAlgo
    Cores computing algorithm.

    Given a graph \(G=(V,E)\), a subgraph \(H\) induced by a subset of vertices \(W\) is a \(k\)-core or a core of order \(k\) if \(\forall v \in W : deg_H(v) \geq k\) and \(H\) is a maximal subgraph with this property. The core number of vertex is the highest order of a core that contains this vertex. The degree \(deg(v)\) can be: in-degree, out-degree, in-degree + out-degree, determining different types of cores. See EdgeDirection for more details.

    Use newInstance() to get a default implementation of this interface.

    Author:
    Barak Ugav
    See Also:
    EdgeDirection
    • Method Detail

      • computeCores

        default <V,​E> CoresAlgo.Result<V,​E> computeCores​(Graph<V,​E> g)
        Compute the cores of the graph with respect to both in and out degree of the vertices.

        If g is IntGraph, the returned object is CoresAlgo.IResult.

        For a detail description of the cores definition, see the interface documentation CoresAlgo.

        Type Parameters:
        V - the vertices type
        E - the edges type
        Parameters:
        g - a graph
        Returns:
        the cores of the graph
      • computeCores

        <V,​E> CoresAlgo.Result<V,​E> computeCores​(Graph<V,​E> g,
                                                             EdgeDirection degreeType)
        Compute the cores of the graph with respect the given degree type.

        Cores are defined with respect to either the out edges, in edges, or both. For undirected graphs the degree type is ignored.

        If g is IntGraph, the returned object is CoresAlgo.IResult.

        For a detail description of the cores definition, see the interface documentation CoresAlgo.

        Type Parameters:
        V - the vertices type
        E - the edges type
        Parameters:
        g - a graph
        degreeType - the degree type the cores are computed with respect to
        Returns:
        the cores of the graph
      • newInstance

        static CoresAlgo newInstance()
        Create a new cores algorithm object.

        This is the recommended way to instantiate a new CoresAlgo object.

        Returns:
        a default implementation of CoresAlgo