Class SuccinctUndirectedGraph.SuccinctGraphIterables

  • All Implemented Interfaces:
    java.io.Serializable, GraphIterables<java.lang.Integer,​it.unimi.dsi.fastutil.ints.IntIntSortedPair>
    Enclosing class:
    SuccinctUndirectedGraph

    private static final class SuccinctUndirectedGraph.SuccinctGraphIterables
    extends java.lang.Object
    implements GraphIterables<java.lang.Integer,​it.unimi.dsi.fastutil.ints.IntIntSortedPair>, java.io.Serializable
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long edgeCount()
      Return the number of edges in the graph.
      java.lang.Iterable<it.unimi.dsi.fastutil.ints.IntIntSortedPair> edges()
      Returns an iterable over the edges of the graph.
      java.lang.Iterable<it.unimi.dsi.fastutil.ints.IntIntSortedPair> edgesOf​(java.lang.Integer source)
      Returns an iterable view over all edges touching the specified vertex.
      Graph<java.lang.Integer,​it.unimi.dsi.fastutil.ints.IntIntSortedPair> getGraph()
      Get the underlying graph.
      java.lang.Iterable<it.unimi.dsi.fastutil.ints.IntIntSortedPair> incomingEdgesOf​(java.lang.Integer vertex)
      Returns an iterable view over all edges incoming into the specified vertex.
      java.lang.Iterable<it.unimi.dsi.fastutil.ints.IntIntSortedPair> outgoingEdgesOf​(java.lang.Integer vertex)
      Returns an iterable view over all edges outgoing into the specified vertex.
      private java.lang.Iterable<it.unimi.dsi.fastutil.ints.IntIntSortedPair> reverseSortedEdgesOfNoLoops​(int target)  
      private java.lang.Iterable<it.unimi.dsi.fastutil.ints.IntIntSortedPair> sortedEdges​(int source)  
      long vertexCount()
      Return the number of vertices in the graph.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SuccinctGraphIterables

        private SuccinctGraphIterables()
    • Method Detail

      • getGraph

        public Graph<java.lang.Integer,​it.unimi.dsi.fastutil.ints.IntIntSortedPair> getGraph()
        Description copied from interface: GraphIterables
        Get the underlying graph.
        Specified by:
        getGraph in interface GraphIterables<java.lang.Integer,​it.unimi.dsi.fastutil.ints.IntIntSortedPair>
        Returns:
        the underlying graph
      • vertexCount

        public long vertexCount()
        Description copied from interface: GraphIterables
        Return the number of vertices in the graph.
        Specified by:
        vertexCount in interface GraphIterables<java.lang.Integer,​it.unimi.dsi.fastutil.ints.IntIntSortedPair>
        Returns:
        the number of vertices
      • edgeCount

        public long edgeCount()
        Description copied from interface: GraphIterables
        Return the number of edges in the graph.
        Specified by:
        edgeCount in interface GraphIterables<java.lang.Integer,​it.unimi.dsi.fastutil.ints.IntIntSortedPair>
        Returns:
        the number of edges.
      • edges

        public java.lang.Iterable<it.unimi.dsi.fastutil.ints.IntIntSortedPair> edges()
        Description copied from interface: GraphIterables
        Returns an iterable over the edges of the graph.

        Whether the ordering is deterministic, depends on the actual graph implementation. It is the responsibility of callers who rely on this behavior to only use graph implementations which support it.

        Specified by:
        edges in interface GraphIterables<java.lang.Integer,​it.unimi.dsi.fastutil.ints.IntIntSortedPair>
        Returns:
        an iterable over the edges of the graph.
      • edgesOf

        public java.lang.Iterable<it.unimi.dsi.fastutil.ints.IntIntSortedPair> edgesOf​(java.lang.Integer source)
        Description copied from interface: GraphIterables
        Returns an iterable view over all edges touching the specified vertex. The returned iterators are live views. If the graph is modified while an iteration is in progress, the results of the iteration are undefined. If no edges are touching the specified vertex, the returned iterators are already exhausted.
        Specified by:
        edgesOf in interface GraphIterables<java.lang.Integer,​it.unimi.dsi.fastutil.ints.IntIntSortedPair>
        Parameters:
        source - input vertex
        Returns:
        an iterable view of the vertices contained in this graph
      • sortedEdges

        private java.lang.Iterable<it.unimi.dsi.fastutil.ints.IntIntSortedPair> sortedEdges​(int source)
      • reverseSortedEdgesOfNoLoops

        private java.lang.Iterable<it.unimi.dsi.fastutil.ints.IntIntSortedPair> reverseSortedEdgesOfNoLoops​(int target)
      • incomingEdgesOf

        public java.lang.Iterable<it.unimi.dsi.fastutil.ints.IntIntSortedPair> incomingEdgesOf​(java.lang.Integer vertex)
        Description copied from interface: GraphIterables
        Returns an iterable view over all edges incoming into the specified vertex. The returned iterators are live views. If the graph is modified while an iteration is in progress, the results of the iteration are undefined.

        In the case of undirected graphs the returned iterators return all edges touching the vertex, thus, some of the returned edges may have their source and target vertices in the opposite order.

        Specified by:
        incomingEdgesOf in interface GraphIterables<java.lang.Integer,​it.unimi.dsi.fastutil.ints.IntIntSortedPair>
        Parameters:
        vertex - input vertex
        Returns:
        an iterable view of all edges incoming into the specified vertex
      • outgoingEdgesOf

        public java.lang.Iterable<it.unimi.dsi.fastutil.ints.IntIntSortedPair> outgoingEdgesOf​(java.lang.Integer vertex)
        Description copied from interface: GraphIterables
        Returns an iterable view over all edges outgoing into the specified vertex. The returned iterators are live views. If the graph is modified while an iteration is in progress, the results of the iteration are undefined.

        In the case of undirected graphs the returned iterators return all edges touching the vertex, thus, some of the returned edges may have their source and target vertices in the opposite order.

        Specified by:
        outgoingEdgesOf in interface GraphIterables<java.lang.Integer,​it.unimi.dsi.fastutil.ints.IntIntSortedPair>
        Parameters:
        vertex - input vertex
        Returns:
        an iterable view of all edges outgoing from the specified vertex