pub struct GraphSampling;Expand description
Graph sampling using various strategies
Implementations§
Source§impl GraphSampling
impl GraphSampling
Sourcepub fn random_node_sampling(
&self,
graph: &ArrowGraph,
sample_size: usize,
seed: Option<u64>,
) -> Result<Vec<String>>
pub fn random_node_sampling( &self, graph: &ArrowGraph, sample_size: usize, seed: Option<u64>, ) -> Result<Vec<String>>
Random node sampling
Sourcepub fn random_edge_sampling(
&self,
graph: &ArrowGraph,
sample_ratio: f64,
seed: Option<u64>,
) -> Result<RecordBatch>
pub fn random_edge_sampling( &self, graph: &ArrowGraph, sample_ratio: f64, seed: Option<u64>, ) -> Result<RecordBatch>
Random edge sampling
Sourcepub fn snowball_sampling(
&self,
graph: &ArrowGraph,
seed_nodes: &[String],
k_hops: usize,
max_nodes: Option<usize>,
) -> Result<Vec<String>>
pub fn snowball_sampling( &self, graph: &ArrowGraph, seed_nodes: &[String], k_hops: usize, max_nodes: Option<usize>, ) -> Result<Vec<String>>
Snowball sampling (BFS-based expansion)
Trait Implementations§
Source§impl GraphAlgorithm for GraphSampling
impl GraphAlgorithm for GraphSampling
fn execute( &self, graph: &ArrowGraph, params: &AlgorithmParams, ) -> Result<RecordBatch>
fn name(&self) -> &'static str
fn description(&self) -> &'static str
Auto Trait Implementations§
impl Freeze for GraphSampling
impl RefUnwindSafe for GraphSampling
impl Send for GraphSampling
impl Sync for GraphSampling
impl Unpin for GraphSampling
impl UnsafeUnpin for GraphSampling
impl UnwindSafe for GraphSampling
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