You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/graph.jl
+98Lines changed: 98 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -198,6 +198,104 @@ function Base.show(io::IO, ::MIME"text/plain", d::HeteroGraph)
198
198
end
199
199
end
200
200
201
+
struct TemporalSnapshotsGraph <:AbstractGraph
202
+
num_nodes::Vector{Int}
203
+
num_edges::Vector{Int}
204
+
num_snapshots::Int
205
+
snapshots::Vector{Graph}
206
+
graph_data::Any
207
+
end
208
+
209
+
210
+
"""
211
+
TemporalSnapshotsGraph(; kws...)
212
+
213
+
A type that represents a temporal snapshot graph as a sequence of [`Graph`](@ref)s and can store graph data.
214
+
215
+
Nodes are indexed in `1:num_nodes` and snapshots are indexed in `1:num_snapshots`.
216
+
217
+
# Keyword Arguments
218
+
219
+
- `num_nodes`: a vector containing the number of nodes at each snapshot.
220
+
- `edge_index`: a tuple containing three vectors.
221
+
The first vector contains the list of the source nodes of each edge, the second the target nodes at the third contains the snapshot at which each edge exists.
222
+
Defaults to `(Int[], Int[], Int[])`.
223
+
- `node_data`: node-related data. Can be `nothing`, a vector of named tuples of arrays or a dictionary of arrays.
224
+
The arrays' last dimension size should be equal to the number of nodes.
225
+
Default `nothing`.
226
+
- `edge_data`: edge-related data. Can be `nothing`, a vector of named tuples of arrays or a dictionary of arrays.
227
+
The arrays' last dimension size should be equal to the number of edges.
228
+
Default `nothing`.
229
+
- `graph_data`: graph-related data. Can be `nothing`, or a named tuple of arrays or a dictionary of arrays.
0 commit comments