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
# `_get_edge_metadata` must return NamedTuple() (or maybe `nothing` would be better?) instead of throwing an exception in order for `edges` to consistently work on layers and interlayers
17
17
_get_edge_metadata(g::Graphs.SimpleGraphs.AbstractSimpleGraph{T}, src::T, dst::T ) where T =NamedTuple()
18
18
19
-
weights(g::Graphs.SimpleGraphs.AbstractSimpleGraph{T}) where T =adjacency_matrix(g)
19
+
Graphs.weights(g::Graphs.SimpleGraphs.AbstractSimpleGraph{T}) where T =adjacency_matrix(g)
Copy file name to clipboardExpand all lines: src/graphs_extensions/metagraphs.jl
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -99,4 +99,4 @@ _get_edge_metadata(g::AbstractMetaGraph{T}, src::T, dst::T ) where T = NamedTupl
99
99
100
100
_set_metadata!(g::AbstractMetaGraph{T}, src::T, dst::T, metadata::NamedTuple) where T =set_props!(g, src, dst, Dict(key => value for (key,value) inpairs(metadata)))
101
101
102
-
weights(g::AbstractMetaGraph{T}) where T =adjacency_matrix(g)
102
+
Graphs.weights(g::AbstractMetaGraph{T}) where T =adjacency_matrix(g)
) where {T<:Integer, U <: Real, G<:AbstractGraph{T}}
112
+
113
+
Constructor for Interlayer.
114
+
115
+
# ARGUMENTS
116
+
-`layer_1::Layer{T,U}`: one of the two layers connected by the Interlayer;
117
+
-`layer_2::Layer{T,U}`: one of the two layers connected by the Interlayer;
118
+
-`ne::Int64`: The number of edges of the Interlayer
119
+
`null_graph::G`: the Interlayer's underlying graph type, which must be passed as a null graph. If it is not, an error will be thrown.
120
+
121
+
# KWARGS
122
+
123
+
-`default_edge_weight::Function`: Function that takes a pair of `MultilayerVertex`s and returns an edge weight of type `weighttype` or `nothing` (which is compatible with unweighted underlying graphs and corresponds to `one(weighttype)` for weighted underlying graphs). Defaults to `(src, dst) -> nothing`;
124
+
-`default_edge_metadata::Function`: Function that takes a pair of `MultilayerVertex`s and returns a `Tuple` or a `NamedTuple` containing the edge metadata, that will be called when `add_edge!(mg,src,dst, args...; kwargs...)` is called without the `metadata` keyword argument, and when generating the edges in this constructor. Defaults to `(src, dst) -> NamedTuple()`;
125
+
-`name::Symbol`: The name of the Interlayer. Defaults to Symbol("interlayer_(layer_1.name)_(layer_2.name)");
126
+
-`transfer_vertex_metadata::Bool`:if true, vertex metadata found in both connected layers are carried over to the vertices of the Interlayer. NB: not all choice of underlying graph may support this feature. Graphs types that don't support metadata or that pose limitations to it may result in errors.;
0 commit comments