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: docs/src/API.md
+48-1Lines changed: 48 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# API
2
2
3
-
This page lists all exported methods, organizing them by topic (whether it is a method that acts on vertices, edges, layers, etc) and by audience: due to how it was possible to integrate multilayer graphs within the `Graphs.jl` ecosystem, some methods are intended for developers who wish to use this library just as any other `Graphs.jl`package in their code, while others are meant to be employed by the end-user.
3
+
This page provides a list of exported methods organized by topic and audience. Methods that act on vertices, edges, and layers are grouped together. Some methods are intended for developers who want to use the `Graphs.jl`library as part of their code, while others are meant for end-users.
4
4
5
5
## End-User
6
6
@@ -191,15 +191,60 @@ specify_interlayer!(
191
191
mg::M,
192
192
new_interlayer::In
193
193
) where {T,U,G<:AbstractGraph{T},M<:AbstractMultilayerUGraph{T,U},In<:Interlayer{T,U,G}}
layer_1_name ∈ mg.layers_names ||throw(ErrorException("$layer_1_name doesn't belong to the multilayer graph. Available layers are $(mg.layers_names)."))
427
430
layer_2_name ∈ mg.layers_names ||throw(ErrorException("$layer_2_name doesn't belong to the multilayer graph. Available layers are $(mg.layers_names)."))
@@ -479,39 +482,39 @@ end
479
482
480
483
# Graphs.jl's internals and ecosystem extra overrides
481
484
"""
482
-
indegree( mg::M, v::V) where {T,M<:AbstractMultilayerGraph{T,<:Real},V<:MultilayerVertex}
indegree( mg::M, vs::AbstractVector{V}=vertices(mg)) where {T,M<:AbstractMultilayerGraph{T,<:Real},V<:MultilayerVertex}
490
493
491
494
Get the vector of indegrees of vertices `vs` in `mg`.
492
495
"""
493
-
Graphs.indegree(mg::M, vs::AbstractVector{V}=vertices(mg))where {T,M<:AbstractMultilayerGraph{T,<:Real},V<:MultilayerVertex}= [indegree(mg, x) for x in vs]
496
+
Graphs.indegree(mg::AbstractMultilayerGraph, vs::AbstractVector{<:MultilayerVertex}=vertices(mg)) = [indegree(mg, x) for x in vs]
494
497
495
498
"""
496
-
outdegree(mg::M, v::V) where {T,M<:AbstractMultilayerGraph{T,<:Real},V<:MultilayerVertex}
outdegree(mg::M, vs::AbstractVector{V}=vertices(mg)) where {T,M<:AbstractMultilayerGraph{T,<:Real},V<:MultilayerVertex}
504
507
505
508
Get the vector of outdegrees of vertices `vs` in `mg`.
506
509
"""
507
-
Graphs.outdegree(mg::M, vs::AbstractVector{V}=vertices(mg))where {T,M<:AbstractMultilayerGraph{T,<:Real},V<:MultilayerVertex}= [outdegree(mg, x) for x in vs]
510
+
Graphs.outdegree(mg::AbstractMultilayerGraph, vs::AbstractVector{<:MultilayerVertex}=vertices(mg)) = [outdegree(mg, x) for x in vs]
508
511
509
512
"""
510
-
degree(mg::M, vs::AbstractVector{V}=vertices(mg)) where {T,M<:AbstractMultilayerGraph{T,<:Real},V<:MultilayerVertex}
Graphs.degree(mg::M, vs::AbstractVector{V}=vertices(mg))where {T,M<:AbstractMultilayerGraph{T,<:Real},V<:MultilayerVertex}= [degree(mg, x) for x in vs]
517
+
Graphs.degree(mg::AbstractMultilayerGraph, vs::AbstractVector{<:MultilayerVertex}=vertices(mg)) = [degree(mg, x) for x in vs]
multilayer_clustering_coefficient(mg::M, norm_factor::Union{Float64, Symbol} = :max) where {M <: AbstractMultilayerGraph}
786
+
multilayer_global_clustering_coefficient(
787
+
mg::AbstractMultilayerGraph,
788
+
norm_factor::Union{Float64,Symbol}=:max
789
+
)
784
790
785
791
Return the complete multilayer global clustering coefficient, equal to the ratio of realized triplets over all possible triplets, including those whose every or some edges belong to interlayers, normalized by `norm_factor`. If `norm_factor == :max`, then the ratio is normalized by `maximum(mg.array)`. This function does not override Graphs.jl's `global_clustering_coefficient`, since the latter does not consider cliques where two nodes are the same node but in different layers/interlayers. See [De Domenico et al. (2013)](https://doi.org/10.1103/PhysRevX.3.041022).
@@ -886,7 +895,12 @@ function overlay_clustering_coefficient(
886
895
end
887
896
888
897
"""
889
-
eigenvector_centrality(mg::M; norm::String = "1", tol::Float64 = 1e-6, maxiter::Int64 = 2000) where {T, U, M <: AbstractMultilayerGraph{T, U}}
898
+
eigenvector_centrality(
899
+
mg::M;
900
+
norm::String = "1",
901
+
tol::Float64 = 1e-6,
902
+
maxiter::Int64 = 2000
903
+
) where {T, U, M <: AbstractMultilayerGraph{T, U}}
890
904
891
905
Calculate the eigenvector centrality of `mg` via an iterative algorithm. The `norm` parameter may be `"1"` or `"n"`, and respectively the eigenvector centrality will be normalized to 1 or further divided by the number of nodes of `mg`. The `tol` parameter terminates the approximation when two consecutive iteration differ by no more than `tol`. The `maxiters` parameter terminates the algorithm when it goes beyond `maxiters` iterations.
892
906
@@ -944,7 +958,11 @@ function Graphs.eigenvector_centrality(
944
958
end
945
959
946
960
"""
947
-
modularity(mg::M, c::Matrix{Int64}; null_model::Union{String,Array{U,4}} = "degree") where {T, U, M <: AbstractMultilayerGraph{T,U}}
961
+
modularity(
962
+
mg::M,
963
+
c::Matrix{Int64};
964
+
null_model::Union{String,Array{U,4}} = "degree"
965
+
) where {T, U, M <: AbstractMultilayerGraph{T,U}}
948
966
949
967
Calculate the modularity of `mg`, as shown in [De Domenico et al. (2013)](https://doi.org/10.1103/PhysRevX.3.041022).
0 commit comments