API

NestedGraphs.edgeMethod
edge(
    ng::NestedGraph,
    ce::NestedEdge
) -> Graphs.SimpleGraphs.SimpleEdge{Int64}

Convert a local view NestedEdge to a global view

source
NestedGraphs.getallsubgraphpathsMethod
getallsubgraphpaths(
    ng::NestedGraph;
    startingpath
) -> Union{Nothing, Vector{Vector{Int64}}}

Get all id path that lead to a subgraph, starting with startingpath. If no startingpath is given, search all subgraphs.

source
NestedGraphs.getfoldedgraphMethod
getfoldedgraph(
    ng::NestedGraph,
    subgrpaths::Array{Array{T<:Integer, 1}, 1}
) -> Any

Get flat graph by substituting graphs identified with subgrpaths with nodes. Return also a mapping.

source
NestedGraphs.getgraphMethod
getgraph(
    ng::NestedGraph
) -> AbstractGraph{T} where T<:Integer

Get the flat graph NestedGraph.flatgr

source
NestedGraphs.getmlsquashedgraphMethod
getmlsquashedgraph(ng::NestedGraph) -> Any

Get a squashed multilayer graph. All multilayer vertices are squashed down to a single vertex. All edges in all layers are merged.

source
NestedGraphs.getmlverticesMethod
getmlvertices(ng::NestedGraph; subgraph_view) -> Any

Get all multilayer vertices. Each multilayer vertex is composed by vertices of the graph that are connected and in different layers. In other words, return all nodes of ng that are connected through the interlinks, i.e., the NestedEdges, i.e., the edges connecting different layers, i.e., the edges connecting different subgraphs. Malfunctions if more nodes across layers are connected with several non-vertical ways.

source
NestedGraphs.getsquashedgraphMethod
getsquashedgraph(
    ng::NestedGraph{T, R, N},
    sqvertices::Array{Array{Q<:Integer, 1}, 1}
) -> Any

sqvertices are the nodes to be merged/squashed together to the flatgr of ng. Return also a mapping of the ng vertices to the new vertices of the graph. Essentially it recursively calls Graphs.merge_vertices.

source
NestedGraphs.nestededgeMethod
nestededge(
    ng::NestedGraph,
    e::Graphs.SimpleGraphs.SimpleEdge
) -> NestedEdge

Convert a global view of an edge to local view NestedEdge

source
NestedGraphs.roll_vertexMethod
roll_vertex(
    ng::NestedGraph,
    v::AbstractArray{T<:Integer, 1}
) -> Union{Nothing, Int64}

Given a vector of the nested inner subgraphs get the index in the flat graph. The last element of the vector is handled as the node number in the v[1:end-1] inner nested graph

source
NestedGraphs.subgraphedgeMethod
subgraphedge(
    ng::NestedGraph,
    e::Graphs.SimpleGraphs.SimpleEdge
) -> Union{Nothing, Graphs.SimpleGraphs.SimpleEdge}

Get the subgraph of an edge If the edge connects 2 subgraphs, it returns nothing

source
NestedGraphs.vertexMethod
vertex(
    ng::NestedGraph,
    cv::Tuple{T, T} where T<:Integer
) -> Union{Nothing, Int64}

Convert a local view NestedVertex to a global view

source
NestedGraphs.NestedEdgeType
struct NestedEdge{T<:Integer} <: Graphs.SimpleGraphs.AbstractSimpleEdge{T<:Integer}
  • src::Tuple{T, T} where T<:Integer

  • dst::Tuple{T, T} where T<:Integer

A NestedEdge connects graphs inside a NestedGraph or simply nodes inside a NestedGraph. The NestedEdge connects two NestedVertexs. This means that every NestedEdge connects to a specific node and not as a hyperedge to the whole subgraph graph.

source
NestedGraphs.NestedGraphType
struct NestedGraph{T<:Integer, R<:AbstractGraph{T<:Integer}, N<:AbstractGraph} <: AbstractGraph{T<:Integer}
  • flatgr::AbstractGraph{T} where T<:Integer: Flat graph view combining all subgraph graphs given with the edges

  • grv::Vector{N} where N<:AbstractGraph: Original subgraph graphs

  • neds::Array{NestedEdge{T}, 1} where T<:Integer: intersubgraph edges

  • vmap::Array{Tuple{T, T}, 1} where T<:Integer: Maps the nodes of flat network to the original graph (Subgraph, Node)

A NestedGraph is a graph of vertices, where each vertex can be a complete graph. Connections are done with NestedEdges and the vertices are NestedVertexs. NestedGraphs of NestedGraphs are allowed.

source
NestedGraphs.NestedGraphMethod
NestedGraph(
    grv::Array{R<:AbstractGraph, 1},
    edges::AbstractVector;
    both_ways
) -> NestedGraph{Int64, _A} where _A<:AbstractGraph{Int64}

both_ways controls whether edges should be added also in reverse.

source
NestedGraphs.NestedVertexType
struct Tuple{T<:Integer, T<:Integer}

A NestedVertex is the local view of a vertex inside a NestedGraph. It contains the subgraph and the vertex indices. Basically, it's an alias for a 2-element Tuple.

source

Index