pub struct SnapshotGraph {
pub snapshots: Vec<GraphSnapshot>,
pub time_window: Option<f64>,
}Expand description
Sequence of graph snapshots forming a temporal graph.
Fields§
§snapshots: Vec<GraphSnapshot>Ordered list of snapshots.
time_window: Option<f64>Optional time-window width used when building snapshots.
Implementations§
Source§impl SnapshotGraph
impl SnapshotGraph
Sourcepub fn with_time_window(self, window: f64) -> Self
pub fn with_time_window(self, window: f64) -> Self
Attach a time-window parameter.
Sourcepub fn add_snapshot(&mut self, snapshot: GraphSnapshot)
pub fn add_snapshot(&mut self, snapshot: GraphSnapshot)
Insert a snapshot, maintaining chronological order.
Sourcepub fn n_snapshots(&self) -> usize
pub fn n_snapshots(&self) -> usize
Number of snapshots.
Sourcepub fn snapshot_at(&self, t: f64) -> Option<&GraphSnapshot>
pub fn snapshot_at(&self, t: f64) -> Option<&GraphSnapshot>
Get the snapshot whose timestamp is closest to t.
Sourcepub fn temporal_degree(&self, node: usize) -> Vec<(f64, usize)>
pub fn temporal_degree(&self, node: usize) -> Vec<(f64, usize)>
Temporal degree sequence: (time, degree) for every snapshot.
Sourcepub fn burstiness(&self, src: usize, dst: usize) -> f64
pub fn burstiness(&self, src: usize, dst: usize) -> f64
Burstiness coefficient B = (σ-μ)/(σ+μ) for inter-event times of edge (src,dst).
Returns 0.0 when there are fewer than two activations.
Sourcepub fn temporal_correlation(&self, lag: usize) -> f64
pub fn temporal_correlation(&self, lag: usize) -> f64
Graph-level temporal autocorrelation (Jaccard similarity of edge sets at lag lag).
Trait Implementations§
Source§impl Clone for SnapshotGraph
impl Clone for SnapshotGraph
Source§fn clone(&self) -> SnapshotGraph
fn clone(&self) -> SnapshotGraph
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SnapshotGraph
impl Debug for SnapshotGraph
Auto Trait Implementations§
impl Freeze for SnapshotGraph
impl RefUnwindSafe for SnapshotGraph
impl Send for SnapshotGraph
impl Sync for SnapshotGraph
impl Unpin for SnapshotGraph
impl UnsafeUnpin for SnapshotGraph
impl UnwindSafe for SnapshotGraph
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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