Temporal Network
- class TemporalNetwork[source]
Base class for temporal networks
Temporal networks are networks with time-varying edges. They consist of nodes and edges, and latter can have time-varying weights.
- Variables
nodes (list of (str or int)) – Sorted list of node names. Node names can be either strings or integers, but they all need to be of the same type.
times (list of (int or float)) – Sorted list of times for which we have temporal information
tedges (pandas.DataFrame) – Dataframe containing tedges, also called timestamped data (potentially weighted). Columns are [‘i’, ‘j’, ‘t’, (‘weight’)] and each row represents a tedge.
snapshots (numpy array) – Array of shape (T, N, N) storing the instantaneous values of the adjacency matrix A_{ij}(t).
Constructors
Base class for temporal networks |
|
|
Creates a TemporalNetwork from a dataframe of tedges |
|
Creates a TemporalNetwork from a DataFrame of edge timeseries |
|
Creates a temporal network by combining node timeseries into edge timeseries. |
Creates a temporal network by combining a static network with tedges |
|
|
Creates a temporal network by combining a static network with edge timeseries |
|
Creates a temporal network by combining a static network with node timeseries |
Utils
Returns the number of nodes |
|
Returns the number of times |
|
Returns the shape (N,T) of the TemporalNetwork |
|
Returns the number of edges in the aggregated network |
|
Returns True if tedges are weighted |
|
|
Returns True if node is in the TemporalNetwork |
|
Returns True if time is in the TemporalNetwork |
|
Returns True if tedge is in the TemporalNetwork, regardless of its weight |
Methods for nodes and edges
|
Adds multiple tedges (optionally weighted) |
Returns a dictionary of neighboring nodes in the aggregate network. |
|
|
Returns dict of edge time series. |
|
Returns a filtered DataFrame containing only the tedges of edge 'edge'. |
|
Returns a filtered DataFrame containing only the tedges of node 'node'. |
Returns a list of edges in the aggregated network |
Methods
Returns a time-aggregated network as a networkx.Graph |
|
Returns a copy of the temporal network as a PartiallyTemporalNetwork |
|
Discards temporal information from 'edge' by setting its weight to a constant |
|
Discards temporal information from 'node' by setting the weight of its edges to a constant |
Partially Temporal Network
A PartiallyTemporalNetwork is a TemporalNetwork for which we do not have temporal information about a subset of the edges. In some sense, it is in between a static and a temporal network.
- class PartiallyTemporalNetwork[source]
Base class for partially temporal networks
Partially temporal networks are temporal networks for which we do not have temporal information about all edges.
- Variables
nodes (list of (str or int)) – Sorted list of node names. Node names can be either strings or integers, but they all need to be of the same type.
times (list of (int or float)) – Sorted list of times for which we have temporal information
tedges (pandas.DataFrame) – Dataframe containing tedges (potentially weighted). Columns are [‘i’, ‘j’, ‘t’, (‘weight’)] and each row represents a tedge.
snapshots (numpy array) – Array of shape (T, N, N) storing the instantaneous values of the adjacency matrix A_{ij}(t).
temporal_nodes (list of (str or int)) – List of nodes that are part of a temporal edge
temporal_edges (list of tuples) – List of edges for which we have temporal information
Specific methods
It is implemented as a child class of the TemporalNetwork class, and contains the additional attributes temporal_nodes and temporal_edges and the following methods:
Returns the number of temporal edges in the temporal network |
|
Returns the number of temporal nodes in the temporal network |
|
Returns the fraction of temporal edges in the temporal network |
|
Returns the fraction of temporal edges in the temporal network |
|
Returns a dict of neighbors in the aggregated network that are temporal nodes |