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: README.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,10 @@ In the package documentation you can find a [tutorial](https://juliagraphs.org/M
54
54
-[ ][Implement more general configuration models / graph generators](https://github.com/JuliaGraphs/MultilayerGraphs.jl/issues/33);
55
55
-[ ][Implement graph of layers](https://github.com/JuliaGraphs/MultilayerGraphs.jl/issues/34);
56
56
-[ ][Implement projected monoplex and overlay graphs](https://github.com/JuliaGraphs/MultilayerGraphs.jl/issues/35);
57
-
-[ ][Implement more default multilayer graphs](https://github.com/JuliaGraphs/MultilayerGraphs.jl/issues/36) (e.g. multiplex graphs).
57
+
-[ ][Implement more default multilayer graphs](https://github.com/JuliaGraphs/MultilayerGraphs.jl/issues/36) (e.g. multiplex graphs);
58
+
-[ ][Implement configuration models / graph generators for interlayers](https://github.com/JuliaGraphs/MultilayerGraphs.jl/issues/46);
59
+
-[ ][Relax the requirement of same `T` and `U` for all `Layer`s and `Interlayer`s that are meant to constitute a `Multilayer(Di)Graph`](https://github.com/JuliaGraphs/MultilayerGraphs.jl/issues/53);
60
+
-[ ][Implement multilayer graph data visualisation functionalities (or a new package)](https://github.com/JuliaGraphs/MultilayerGraphs.jl/issues/54).
Copy file name to clipboardExpand all lines: src/MultilayerGraphs.jl
+23-2Lines changed: 23 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@
14
14
15
15
# The δ_Ω implementation could be moved to a separate file.
16
16
17
-
# The usage of mutable `MissingVertex`s (although limited to SupraWeightMatrix) points to the fact that Bijections (at least as they are used right now) are not the best way to represent integer label-MultilayerVertex associations. We my implement our own container object or use the exixtsing ons differently.
17
+
# The usage of mutable `MissingVertex`s (although limited to SupraWeightMatrix) points to the fact that Bijections (at least as they are used right now) are not the best way to represent integer label-MultilayerVertex associations. We my implement our own container object or use the existing ons differently.
18
18
19
19
# We need a quick Multilayer(Di)Graph constructor of the form Multilayer(Di)Graph(nn, nl; nv = rand(0:nn*nl), ne = rand(0:nv*(nv-1)) kwargs...) where kwargs may be used to further specify it.
20
20
@@ -59,6 +59,7 @@ export
59
59
mv_outneighbors,
60
60
neighbors,
61
61
mv_neighbors,
62
+
get_v,
62
63
edgetype,
63
64
has_edge,
64
65
ne,
@@ -71,15 +72,34 @@ export
71
72
adjacency_matrix,
72
73
weights,
73
74
name,
75
+
graph,
74
76
# layer.jl
75
77
AbstractLayer,
76
78
Layer,
79
+
layer_simplegraph,
80
+
layer_simpledigraph,
81
+
layer_simpleweightedgraph,
82
+
layer_simpleweighteddigraph,
83
+
layer_metadigraph,
84
+
layer_valgraph,
85
+
layer_valoutdigraph,
86
+
layer_valdigraph,
87
+
layer_metagraph,
77
88
has_node,
78
89
add_vertex!,
79
90
rem_vertex!,
80
91
# interlayer.jl
81
92
AbstractInterlayer,
82
93
Interlayer,
94
+
interlayer_simplegraph,
95
+
interlayer_simpleweightedgraph,
96
+
interlayer_metagraph,
97
+
interlayer_valgraph,
98
+
interlayer_simpledigraph,
99
+
interlayer_simpleweighteddigraph,
100
+
interlayer_metadigraph,
101
+
interlayer_valoutdigraph,
102
+
interlayer_valdigraph,
83
103
multiplex_interlayer,
84
104
empty_interlayer,
85
105
is_multiplex_interlayer,
@@ -151,7 +171,7 @@ export
151
171
kleitman_wang_graph_generator
152
172
# tensorfacoriazations.jl
153
173
154
-
using Base, InteractiveUtils, IterTools, SimpleTraits, Bijections
174
+
using Base, InteractiveUtils, IterTools, SimpleTraits, Bijections, PrettyTables
155
175
using Distributions: Uniform
156
176
using LinearAlgebra, Statistics, OMEinsum, TensorOperations, Distributions
v_V_associations::Bijection{T,<:MultilayerVertex}# A Bijection from Bijections.jl that associates numeric vertices to `MultilayerVertex`s.
10
10
idx_N_associations::Bijection{Int64,Node}# A Bijection from Bijections.jl that associates Int64 to `Node`s.
11
11
fadjlist::Vector{Vector{HalfEdge{<:MultilayerVertex,<:Union{Nothing,U}}}} # the forward adjacency list of the MultilayerDiGraph. It is a vector of vectors of `HalfEdge`s. Its i-th element are the `HalfEdge`s that originate from `v_V_associations[i]`.
12
-
badjlist::Vector{Vector{HalfEdge{<:MultilayerVertex,<:Union{Nothing,U}}}} # the bacward adjacency list of the MultilayerDiGraph. It is a vector of vectors of `HalfEdge`s. Its i-th element are the `HalfEdge`s that insost on `v_V_associations[i]`.
12
+
badjlist::Vector{Vector{HalfEdge{<:MultilayerVertex,<:Union{Nothing,U}}}} # the backward adjacency list of the MultilayerDiGraph. It is a vector of vectors of `HalfEdge`s. Its i-th element are the `HalfEdge`s that insist on `v_V_associations[i]`.
13
13
v_metadata_dict::Dict{T,<:Union{<:Tuple,<:NamedTuple}}# A Dictionary that associates numeric vertices to their metadata
"Both the `indegree_distribution` and the `outdegree_distribution` must have positive support. Found $(support(indegree_distribution)) and $(support(outdegree_distribution)).",
168
-
),
169
-
)
170
-
171
165
empty_multilayerdigraph =MultilayerDiGraph(
172
166
empty_layers,
173
167
empty_interlayers;
@@ -177,23 +171,9 @@ function MultilayerDiGraph(
177
171
178
172
n =nv(empty_multilayerdigraph)
179
173
180
-
indegree_sequence =Vector{Int64}(undef, n)
181
-
outdegree_sequence =Vector{Int64}(undef, n)
182
-
acceptable =false
183
-
184
-
@info"Trying to sample a digraphical sequence from the two provided distributions..."
@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."
206
+
@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 inconvenience."
n ==length(indegree_sequence) ==length(outdegree_sequence) ||throw(
239
219
ErrorException(
240
-
"The number of vertices of the provided empty MultilayerDiGraph does not match the length of the `indegree_sequence` or the `outdegree_sequence`. Found $(nv(_multilayerdigraph)) , $(length(indegree_sequence)) and $(length(outdegree_sequence))",
220
+
"The number of vertices of the provided empty MultilayerDiGraph does not match the length of the `indegree_sequence` or the `outdegree_sequence`. Found $(nv(_multilayerdigraph)) , $(length(indegree_sequence)) and $(length(outdegree_sequence)).",
0 commit comments