Package com.jgalgo

Interface CoreAlgo


  • public interface CoreAlgo
    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 maximum 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.

    Author:
    Barak Ugav
    See Also:
    CoreAlgo.DegreeType
    • Method Detail

      • computeCores

        default CoreAlgo.Result computeCores​(Graph g)
        Compute the cores of the graph with respect to both in and out degree of the vertices.

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

        Parameters:
        g - a graph
        Returns:
        the cores of the graph
      • computeCores

        CoreAlgo.Result computeCores​(Graph g,
                                     CoreAlgo.DegreeType 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.

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

        Parameters:
        g - a graph
        degreeType - the degree type the cores are computed with respect to
        Returns:
        the cores of the graph
      • newBuilder

        static CoreAlgo.Builder newBuilder()
        Create a new builder for core algorithms.
        Returns:
        a new builder for core algorithms