Class GeneralizedDumbelGraph

  • All Implemented Interfaces:
    it.unimi.dsi.lang.FlyweightPrototype<ImmutableGraph>

    public class GeneralizedDumbelGraph
    extends ImmutableGraph
    A graph with two parameters: a positive integer (k) and an integer value between 1 and k2. The graph is bidirectional and made by two k-cliques with the specified number of edges in between them.
    • Constructor Detail

      • GeneralizedDumbelGraph

        public GeneralizedDumbelGraph​(int k,
                                      int bridge)
      • GeneralizedDumbelGraph

        public GeneralizedDumbelGraph​(java.lang.String... strings)
    • Method Detail

      • copy

        public ImmutableGraph copy()
        Description copied from class: ImmutableGraph
        Returns a flyweight copy of this immutable graph.
        Specified by:
        copy in interface it.unimi.dsi.lang.FlyweightPrototype<ImmutableGraph>
        Specified by:
        copy in class ImmutableGraph
        Returns:
        a flyweight copy of this immutable graph.
        See Also:
        FlyweightPrototype
      • numNodes

        public int numNodes()
        Description copied from class: ImmutableGraph
        Returns the number of nodes of this graph.

        Albeit this method is not optional, it is allowed that this method throws an UnsupportedOperationException if this graph has never been entirely traversed using a node iterator. This apparently bizarre behaviour is necessary to support implementations as ArcListASCIIGraph, which do not know the actual number of nodes until a traversal has been completed.

        Specified by:
        numNodes in class ImmutableGraph
        Returns:
        the number of nodes.
      • outdegree

        public int outdegree​(int x)
        Description copied from class: ImmutableGraph
        Returns the outdegree of a node.
        Specified by:
        outdegree in class ImmutableGraph
        Parameters:
        x - a node.
        Returns:
        the outdegree of the given node.
      • successorArray

        public int[] successorArray​(int x)
        Description copied from class: ImmutableGraph
        Returns a reference to an array containing the successors of a given node.

        The returned array may contain more entries than the outdegree of x. However, only those with indices from 0 (inclusive) to the outdegree of x (exclusive) contain valid data.

        Overrides:
        successorArray in class ImmutableGraph
        Parameters:
        x - a node.
        Returns:
        an array whose first elements are the successors of the node; the array must not be modified by the caller.
      • randomAccess

        public boolean randomAccess()
        Description copied from class: ImmutableGraph
        Checks whether this graph provides random access to successor lists.
        Specified by:
        randomAccess in class ImmutableGraph
        Returns:
        true if this graph provides random access to successor lists.
      • main

        public static void main​(java.lang.String[] arg)