Class WeightedRandomWalkIterator<V>

    • Constructor Detail

      • WeightedRandomWalkIterator

        public WeightedRandomWalkIterator​(IGraph<V,​? extends Number> graph,
                                          int walkLength)
      • WeightedRandomWalkIterator

        public WeightedRandomWalkIterator​(IGraph<V,​? extends Number> graph,
                                          int walkLength,
                                          long rngSeed)
        Construct a RandomWalkIterator for a given graph, with a specified walk length and random number generator seed.
        Uses NoEdgeHandling.EXCEPTION_ON_DISCONNECTED - hence exception will be thrown when generating random walks on graphs with vertices containing having no edges, or no outgoing edges (for directed graphs)
        See Also:
        WeightedRandomWalkIterator(IGraph, int, long, NoEdgeHandling)
      • WeightedRandomWalkIterator

        public WeightedRandomWalkIterator​(IGraph<V,​? extends Number> graph,
                                          int walkLength,
                                          long rngSeed,
                                          NoEdgeHandling mode)
        Parameters:
        graph - IGraph to conduct walks on
        walkLength - length of each walk. Walk of length 0 includes 1 vertex, walk of 1 includes 2 vertices etc
        rngSeed - seed for randomization
        mode - mode for handling random walks from vertices with either no edges, or no outgoing edges (for directed graphs)
      • WeightedRandomWalkIterator

        public WeightedRandomWalkIterator​(IGraph<V,​? extends Number> graph,
                                          int walkLength,
                                          long rngSeed,
                                          NoEdgeHandling mode,
                                          int firstVertex,
                                          int lastVertex)
        Constructor used to generate random walks starting at a subset of the vertices in the graph. Order of starting vertices is randomized within this subset
        Parameters:
        graph - IGraph to conduct walks on
        walkLength - length of each walk. Walk of length 0 includes 1 vertex, walk of 1 includes 2 vertices etc
        rngSeed - seed for randomization
        mode - mode for handling random walks from vertices with either no edges, or no outgoing edges (for directed graphs)
        firstVertex - first vertex index (inclusive) to start random walks from
        lastVertex - last vertex index (exclusive) to start random walks from