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
Construct a MultilayerDiGraph with layers given by `layers`. The interlayers will be constructed by default according to `default_interlayer` where only `"multiplex"` and `"empty"` are allowed, except for those specified in `specified_interlayers`. `default_interlayer = "multiplex"` will imply that unspecified interlayers will have only diagonal couplings, while `default_interlayer = "multiplex"` will produced interlayers that have no couplings.
34
39
"""
@@ -131,7 +136,14 @@ end
131
136
# Multilayer-specific methods
132
137
# "empty graph" could be the correct way of calling a graph with no edges: https://math.stackexchange.com/questions/320859/what-is-the-term-for-a-graph-on-n-vertices-with-no-edges
133
138
"""
134
-
MultilayerDiGraph(empty_layers::Vector{<:Layer{T,U}}, empty_interlayers::Vector{<:Interlayer{T,U}}, degree_distribution::UnivariateDistribution; allow_self_loops::Bool = false, default_interlayers_null_graph::H = SimpleGraph{T}() ) where {T <: Integer, U <: Real, H <: AbstractGraph{T}}
) where {T <: Integer, U <: Real, H <: AbstractGraph{T}}
135
147
136
148
Return a random MultilayerDiGraph that has `empty_layers` as layers and `empty_interlayers` as specified interlayers. `empty_layers` and `empty_interlayers` must respectively be `Layer`s and `Interlayer`s with whatever number of vertices but no edges (if any edge is found, an error is thrown). The degree distribution of the returned random `MultilayerDiGraph` is given by `degree_distribution`, which must have a support that only contains positive numbers for obvious reasons. `allow_self_loops = true` allows for self loops t be present in the final random MultilayerDiGraph. `default_interlayers_null_graph` controls the `null_graph` argument passed to automatically-generated interlayers.
137
149
"""
@@ -173,11 +185,23 @@ function MultilayerDiGraph(
173
185
end
174
186
175
187
"""
176
-
MultilayerDiGraph(empty_multilayerdigraph::MultilayerDiGraph{T,U}, degree_sequence::Vector{<:Integer}; allow_self_loops::Bool = false, perform_checks::Bool = false) where {T,U}
188
+
MultilayerDiGraph(
189
+
empty_multilayerdigraph::MultilayerDiGraph{T,U},
190
+
indegree_sequence::Vector{<:Integer},
191
+
outdegree_sequence::Vector{<:Integer};
192
+
allow_self_loops::Bool = false,
193
+
perform_checks::Bool = false
194
+
) where {T,U}
177
195
178
196
Return a random `MultilayerDiGraph` with degree sequence `degree_sequence`. `allow_self_loops` controls the presence of self-loops, while if `perform_checks` is true, the `degree_sequence` os checked to be graphical.
179
197
"""
180
-
functionMultilayerDiGraph(empty_multilayerdigraph::MultilayerDiGraph{T,U}, indegree_sequence::Vector{<:Integer},outdegree_sequence::Vector{<:Integer} ; allow_self_loops::Bool=false, perform_checks::Bool=false) where {T,U}
198
+
functionMultilayerDiGraph(
199
+
empty_multilayerdigraph::MultilayerDiGraph{T,U},
200
+
indegree_sequence::Vector{<:Integer},
201
+
outdegree_sequence::Vector{<:Integer};
202
+
allow_self_loops::Bool=false,
203
+
perform_checks::Bool=false
204
+
) where {T,U}
181
205
182
206
(allow_self_loops && perform_checks) &&@warn"Checks for graphicality and coherence with the provided `empty_multilayerdigraph` are currently performed without taking into account self-loops. Thus said checks may fail event though the provided `indegree_sequence` and `outdegree_sequence` may be graphical when one allows for self-loops within the directed multilayer graph to be present. If you are sure that the provided `indegree_sequence` and `outdegree_sequence` are indeed graphical under those circumstances, you may want to disable checks by setting `perform_checks = false`. We apologize for the inconvenient."
Construct a MultilayerGraph with layers given by `layers`. The interlayers will be constructed by default according to `default_interlayer` where only `"multiplex"` and `"empty"` are allowed, except for those specified in `specified_interlayers`. `default_interlayer = "multiplex"` will imply that unspecified interlayers will have only diagonal couplings, while `default_interlayer = "multiplex"` will produced interlayers that have no couplings.
32
37
@@ -141,7 +146,13 @@ end
141
146
# Multilayer-specific methods
142
147
# "empty graph" could be the correct way of calling a graph with no edges: https://math.stackexchange.com/questions/320859/what-is-the-term-for-a-graph-on-n-vertices-with-no-edges
143
148
"""
144
-
MultilayerGraph(empty_layers::Vector{<:Layer{T,U}}, empty_interlayers::Vector{<:Interlayer{T,U}}, degree_distribution::UnivariateDistribution; allow_self_loops::Bool = false, default_interlayers_null_graph::H = SimpleGraph{T}() ) where {T <: Integer, U <: Real, H <: AbstractGraph{T}}
) where {T <: Integer, U <: Real, H <: AbstractGraph{T}}
145
156
146
157
Return a random MultilayerGraph that has `empty_layers` as layers and `empty_interlayers` as specified interlayers. `empty_layers` and `empty_interlayers` must respectively be `Layer`s and `Interlayer`s with whatever number of vertices but no edges (if any edge is found, an error is thrown). The degree distribution of the returned random `MultilayerGraph` is given by `degree_distribution`, which must have a support that only contains positive numbers for obvious reasons. `allow_self_loops = true` allows for self loops t be present in the final random MultilayerGraph. `default_interlayers_null_graph` controls the `null_graph` argument passed to automatically-generated interlayers.
147
158
"""
@@ -178,13 +189,16 @@ function MultilayerGraph(
178
189
end
179
190
180
191
"""
181
-
MultilayerGraph(empty_multilayergraph::MultilayerGraph{T,U}, degree_sequence::Vector{<:Integer}; allow_self_loops::Bool = false, perform_checks::Bool = false) where {T,U}
Return a random `MultilayerGraph` with degree sequence `degree_sequence`. `allow_self_loops` controls the presence of self-loops, while if `perform_checks` is true, the `degree_sequence` os checked to be graphical.
184
198
"""
185
199
functionMultilayerGraph(empty_multilayergraph::MultilayerGraph{T,U}, degree_sequence::Vector{<:Integer}; allow_self_loops::Bool=false, perform_checks::Bool=true) where {T,U}
186
200
187
-
(allow_self_loops && perform_checks) &&@warn"Checks for graphicality and coherence with the provided `empty_multilayergraph` are currently performed without taking into account self-loops. Thus said checks may fail event though the provided `degree_sequence` may be graphical when one allows for self-loops within the multilayer graph to be present. If you are sure that the provided `degree_sequence` is indeed graphical under those circumstances, you may want to disable checks by setting `perform_checks = false`. We apologize for the inconvenient."
201
+
(allow_self_loops && perform_checks) &&@warn"Checks for graphicality and coherence with the provided `empty_multilayergraph` are currently performed without taking into account self-loops. Thus said checks may fail even though the provided `degree_sequence` may be graphical when one allows for self-loops within the multilayer graph to be present. If you are sure that the provided `degree_sequence` is indeed graphical under those circumstances, you may want to disable checks by setting `perform_checks = false`. We apologize for the inconvenient."
188
202
189
203
_multilayergraph =deepcopy(empty_multilayergraph)
190
204
@@ -207,7 +221,7 @@ function MultilayerGraph(empty_multilayergraph::MultilayerGraph{T,U}, degree_seq
Return a null MultilayerGraph with with vertex type `T` weighttype `U`. Use this constructor and then add Layers and Interlayers via the `add_layer!` and `specify_interlayer!` methods.
0 commit comments