pub struct RandomWalkGenerator<N: Node> { /* private fields */ }Expand description
Random walk generator for graphs
Implementations§
Source§impl<N: Node> RandomWalkGenerator<N>
impl<N: Node> RandomWalkGenerator<N>
Sourcepub fn simple_random_walk<E, Ix>(
&mut self,
graph: &Graph<N, E, Ix>,
start: &N,
length: usize,
) -> Result<RandomWalk<N>>
pub fn simple_random_walk<E, Ix>( &mut self, graph: &Graph<N, E, Ix>, start: &N, length: usize, ) -> Result<RandomWalk<N>>
Generate a simple random walk from a starting node
Sourcepub fn node2vec_walk<E, Ix>(
&mut self,
graph: &Graph<N, E, Ix>,
start: &N,
length: usize,
p: f64,
q: f64,
) -> Result<RandomWalk<N>>
pub fn node2vec_walk<E, Ix>( &mut self, graph: &Graph<N, E, Ix>, start: &N, length: usize, p: f64, q: f64, ) -> Result<RandomWalk<N>>
Generate a Node2Vec biased random walk
Sourcepub fn generate_walks<E, Ix>(
&mut self,
graph: &Graph<N, E, Ix>,
start: &N,
num_walks: usize,
walk_length: usize,
) -> Result<Vec<RandomWalk<N>>>
pub fn generate_walks<E, Ix>( &mut self, graph: &Graph<N, E, Ix>, start: &N, num_walks: usize, walk_length: usize, ) -> Result<Vec<RandomWalk<N>>>
Generate multiple random walks from a starting node
Trait Implementations§
Auto Trait Implementations§
impl<N> Freeze for RandomWalkGenerator<N>
impl<N> !RefUnwindSafe for RandomWalkGenerator<N>
impl<N> !Send for RandomWalkGenerator<N>
impl<N> !Sync for RandomWalkGenerator<N>
impl<N> Unpin for RandomWalkGenerator<N>where
N: Unpin,
impl<N> !UnwindSafe for RandomWalkGenerator<N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more