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
default_edge_metadata::Function= (x,y) ->NamedTuple(), # 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()`;
254
254
name::Symbol=Symbol("interlayer_$(layer_1.name)_$(layer_2.name)"), # The name of the Interlayer. Defaults to Symbol("interlayer_(layer_1.name)_(layer_2.name)");
255
255
transfer_vertex_metadata::Bool=false# 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.;
256
-
)
256
+
)
257
257
```
258
258
We will build a few of random `Interlayer`s:
259
259
@@ -268,30 +268,30 @@ interlayer_sg_swg = Interlayer( layer_sg, # The first layer to
268
268
)
269
269
# Define a weighted `Interlayer`
270
270
_ne =rand_ne_interlayer(layer_swg, layer_mg)
271
-
interlayer_swg_mg =Interlayer( layer_swg,
271
+
interlayer_swg_mg =Interlayer( layer_swg,
272
272
layer_mg,
273
273
_ne,
274
-
SimpleWeightedGraph{vertextype, _weighttype}();
274
+
SimpleWeightedGraph{vertextype, _weighttype}();
275
275
default_edge_weight = (x,y) ->rand() # Arguments follow the same rules as in Layer
276
-
)
276
+
)
277
277
# Define an `Interlayer` with an underlying `MetaGraph`
transfer_vertex_metadata =true# This boolean kwarg controls whether 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.
285
285
)
286
286
# Define an `Interlayer` with an underlying `ValGraph` from `SimpleValueGraphs.jl`, with diagonal couplings only:
- The *transparent* interface. After you pass to `add_vertex` the `Layer` and the `Node` you wish to add, you may pass the same `args` and `kwargs` that you would pass to the `add_vertex!` dispatch that acts on the underlying graph (after the graph argument). This is a way to let the user directly exploit the API of the underlying graph package, which could be useful for two reasons:
430
430
1. They may be more convenient;
431
431
2. They should work even if we are not able to integrate the *standard* and the *uniform* interface with a particular `Graphs.jl`'s extension.
The uniform interface of `add_edge!` works so that the user may specify the keyword `weight` and/or the keyword `metadata`. If an underlying subgraph has a transparent interface whose signature overlaps with that of the uniform interface, the uniform interface will be prevail.
594
594
595
-
The edge may be removed via
595
+
The edge may be removed via
596
596
597
597
```julia
598
598
rem_edge!(layer_swg, src_w, dst_w)
@@ -671,7 +671,7 @@ Now one may add vertices that represent that node, e.g.:
671
671
new_vertex =MV(new_node, :layer_sg)
672
672
add_vertex!(multilayergraph, new_vertex)
673
673
```
674
-
```nothing
674
+
```nothing
675
675
true
676
676
```
677
677
@@ -680,7 +680,7 @@ And remove the node via `rem_node!`:
680
680
```julia
681
681
rem_node!(multilayergraph, new_node) # Return true if succeeds
# Check that the new layer now exists within the multilayer graph
734
734
has_layer(multilayergraph, :new_layer)
735
735
```
736
-
```nothing
736
+
```nothing
737
737
true
738
738
```
739
739
@@ -742,7 +742,7 @@ The [`add_layer!`](@ref) function will automatically instantiate all the `Interl
742
742
If you wish to manually specify an interlayer, just do:
743
743
744
744
```julia
745
-
# Instantiate a new Interlayer. Notice that its name will be given by default as
745
+
# Instantiate a new Interlayer. Notice that its name will be given by default as
746
746
_ne =rand_ne_interlayer(layer_sg, new_layer)
747
747
new_interlayer =Interlayer( layer_sg,
748
748
new_layer,
@@ -764,7 +764,7 @@ true
764
764
Suppose that, after some modifications of `multilayergraph`, you would like to inspect a particular slice (or subgraph) of it (i.e. a `Layer` or an `Interlayer`). You may use both layers and interlayers names as properties of the multilayer graph itself.
@@ -846,7 +846,8 @@ The package also exports a [`SupraWeightMatrix`](@ref) which is a supra (weighte
846
846
847
847
Read a complete list of analytical methods exclusive to multilayer graphs in the dedicated [API section](@ref msm_eu) (here "exclusive" means that wither those methods do not exists for standard graphs, or that they had to be reimplemented and so may present some caveats). Refer to their docstrings for more information.
848
848
849
-
#### Compatibility with Graphs.jl
849
+
#### Compatibility with Agents.jl
850
+
850
851
`Multilayer(Di)Graph`s may be used as an argument to `GraphSpace` in [Agents.jl](https://github.com/JuliaDynamics/Agents.jl). A complete compatibility example may be found in [this test](https://github.com/JuliaGraphs/MultilayerGraphs.jl/blob/main/test/agents_jl_integration.jl).
851
852
852
853
### Future Developments
@@ -857,17 +858,17 @@ Read a complete list of analytical methods exclusive to multilayer graphs in the
857
858
-[Implement projected monoplex and overlay graphs](https://github.com/JuliaGraphs/MultilayerGraphs.jl/issues/35);
858
859
-[Implement more default multilayer graphs](https://github.com/JuliaGraphs/MultilayerGraphs.jl/issues/36) (e.g. multiplex graphs).
859
860
860
-
## How to Contribute
861
+
## How to Contribute
861
862
862
-
The ongoing development of this package would greatly benefit from the valuable feedback of the esteemed members of the [JuliaGraph](https://github.com/orgs/JuliaGraphs/people) community, as well as from graph theorists, network scientists, and any users who may have general questions or suggestions.
863
+
The ongoing development of this package would greatly benefit from the valuable feedback of the esteemed members of the [JuliaGraph](https://github.com/orgs/JuliaGraphs/people) community, as well as from graph theorists, network scientists, and any users who may have general questions or suggestions.
863
864
864
-
We therefore encourage you to participate in [discussions](https://github.com/JuliaGraphs/MultilayerGraphs.jl/discussions), raise [issues](https://github.com/JuliaGraphs/MultilayerGraphs.jl/issues), or submit [pull requests](https://github.com/JuliaGraphs/MultilayerGraphs.jl/pulls). Your contributions are most welcome!
865
+
We therefore encourage you to participate in [discussions](https://github.com/JuliaGraphs/MultilayerGraphs.jl/discussions), raise [issues](https://github.com/JuliaGraphs/MultilayerGraphs.jl/issues), or submit [pull requests](https://github.com/JuliaGraphs/MultilayerGraphs.jl/pulls). Your contributions are most welcome!
865
866
866
867
## How to Cite
867
868
868
869
If you utilize this package in your project, please consider citing this repository using the citation information provided in [`CITATION.bib`](https://github.com/JuliaGraphs/MultilayerGraphs.jl/blob/main/CITATION.bib). This will help to give appropriate credit to the [contributors](https://github.com/JuliaGraphs/MultilayerGraphs.jl/graphs/contributors) and support the continued development of the package.
869
870
870
-
## Announcements
871
+
## Announcements
871
872
872
873
The package and its features were announced on the following platforms:
873
874
@@ -877,6 +878,6 @@ The package and its features were announced on the following platforms:
877
878
878
879
## References
879
880
880
-
1. De Domenico et al. (2013) [Mathematical Formulation of Multilayer Networks](https://doi.org/10.1103/PhysRevX.3.041022). *Physical Review X*;
881
-
2. Kivelä et al. (2014) [Multilayer networks](https://doi.org/10.1093/comnet/cnu016). *Journal of Complex Networks*;
882
-
3. Bianconi (2018) [Multilayer Networks: Structure and Function](https://global.oup.com/academic/product/multilayer-networks-9780192865540). *Oxford University Press*.
881
+
1. De Domenico et al. (2013) [Mathematical Formulation of Multilayer Networks](https://doi.org/10.1103/PhysRevX.3.041022). *Physical Review X*;
882
+
2. Kivelä et al. (2014) [Multilayer networks](https://doi.org/10.1093/comnet/cnu016). *Journal of Complex Networks*;
883
+
3. Bianconi (2018) [Multilayer Networks: Structure and Function](https://global.oup.com/academic/product/multilayer-networks-9780192865540). *Oxford University Press*.
0 commit comments