pub struct TemporalGraph<N: Node, E: EdgeWeight, Ix: IndexType = u32> { /* private fields */ }
Expand description
A temporal graph where edges have time intervals
Implementations§
Source§impl<N: Node, E: EdgeWeight, Ix: IndexType> TemporalGraph<N, E, Ix>
impl<N: Node, E: EdgeWeight, Ix: IndexType> TemporalGraph<N, E, Ix>
Sourcepub fn add_node(&mut self, node: N, interval: TimeInterval)
pub fn add_node(&mut self, node: N, interval: TimeInterval)
Add a node with a time interval when it exists
Sourcepub fn add_edge(
&mut self,
source: N,
target: N,
weight: E,
interval: TimeInterval,
) -> Result<usize>
pub fn add_edge( &mut self, source: N, target: N, weight: E, interval: TimeInterval, ) -> Result<usize>
Add a temporal edge
Sourcepub fn snapshot_at(&self, time: TimeInstant) -> Graph<N, E, Ix>
pub fn snapshot_at(&self, time: TimeInstant) -> Graph<N, E, Ix>
Get a snapshot of the graph at a specific time
Sourcepub fn edges_in_interval(
&self,
interval: TimeInterval,
) -> Vec<&TemporalEdge<N, E>>
pub fn edges_in_interval( &self, interval: TimeInterval, ) -> Vec<&TemporalEdge<N, E>>
Get all edges active during a time interval
Sourcepub fn change_times(&self) -> Vec<TimeInstant>
pub fn change_times(&self) -> Vec<TimeInstant>
Get all time instants when the graph structure changes
Sourcepub fn active_interval(&self) -> Option<TimeInterval>
pub fn active_interval(&self) -> Option<TimeInterval>
Get the time interval when the graph is active
Sourcepub fn node_count_at(&self, time: TimeInstant) -> usize
pub fn node_count_at(&self, time: TimeInstant) -> usize
Count nodes active at a specific time
Sourcepub fn edge_count_at(&self, time: TimeInstant) -> usize
pub fn edge_count_at(&self, time: TimeInstant) -> usize
Count edges active at a specific time
Sourcepub fn temporal_edges(&self) -> Vec<&TemporalEdge<N, E>>
pub fn temporal_edges(&self) -> Vec<&TemporalEdge<N, E>>
Get all temporal edges
Sourcepub fn are_connected_at(&self, node1: &N, node2: &N, time: TimeInstant) -> bool
pub fn are_connected_at(&self, node1: &N, node2: &N, time: TimeInstant) -> bool
Check if two nodes are connected at a specific time
Sourcepub fn temporal_paths(
&self,
source: &N,
target: &N,
start_time: TimeInstant,
max_duration: u64,
) -> Vec<TemporalPath<N, E>>
pub fn temporal_paths( &self, source: &N, target: &N, start_time: TimeInstant, max_duration: u64, ) -> Vec<TemporalPath<N, E>>
Find temporal paths between two nodes
Trait Implementations§
Source§impl<N: Clone + Node, E: Clone + EdgeWeight, Ix: Clone + IndexType> Clone for TemporalGraph<N, E, Ix>
impl<N: Clone + Node, E: Clone + EdgeWeight, Ix: Clone + IndexType> Clone for TemporalGraph<N, E, Ix>
Source§fn clone(&self) -> TemporalGraph<N, E, Ix>
fn clone(&self) -> TemporalGraph<N, E, Ix>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<N: Debug + Node, E: Debug + EdgeWeight, Ix: Debug + IndexType> Debug for TemporalGraph<N, E, Ix>
impl<N: Debug + Node, E: Debug + EdgeWeight, Ix: Debug + IndexType> Debug for TemporalGraph<N, E, Ix>
Auto Trait Implementations§
impl<N, E, Ix> Freeze for TemporalGraph<N, E, Ix>
impl<N, E, Ix> RefUnwindSafe for TemporalGraph<N, E, Ix>
impl<N, E, Ix> Send for TemporalGraph<N, E, Ix>where
Ix: Send,
impl<N, E, Ix> Sync for TemporalGraph<N, E, Ix>where
Ix: Sync,
impl<N, E, Ix> Unpin for TemporalGraph<N, E, Ix>
impl<N, E, Ix> UnwindSafe for TemporalGraph<N, E, Ix>
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