API
NestedGraphs.edge — Methodedge(
ng::NestedGraph,
ce::NestedEdge
) -> Graphs.SimpleGraphs.SimpleEdge{Int64}
Convert a local view NestedEdge to a global view
NestedGraphs.getallsubgraphpaths — Methodgetallsubgraphpaths(
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.
NestedGraphs.getallsubvertices — Methodgetallsubvertices(ng; startingpath) -> Any
Get all subvertices categorized per subgraph.
NestedGraphs.getfoldedgraph — Methodgetfoldedgraph(
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.
NestedGraphs.getgraph — Methodgetgraph(
ng::NestedGraph
) -> AbstractGraph{T} where T<:Integer
Get the flat graph NestedGraph.flatgr
NestedGraphs.getmlsquashedgraph — Methodgetmlsquashedgraph(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.
NestedGraphs.getmlvertices — Methodgetmlvertices(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.
NestedGraphs.getnestededges — Methodgetnestededges(ng::NestedGraph) -> Any
Get all edges that have no subgraph, i.e. that interconnect subgraphs
NestedGraphs.getsquashedgraph — Methodgetsquashedgraph(
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.
NestedGraphs.getsubgraphs — Methodgetsubgraphs(
ng::NestedGraph
) -> Vector{N} where N<:AbstractGraph
Get the subgraphs NestedGraph.grv
NestedGraphs.gettotalsubgraphs — Methodgettotalsubgraphs(ng::NestedGraph) -> Int64
Get total number of subgraphs
NestedGraphs.nestededge — Methodnestededge(
ng::NestedGraph,
e::Graphs.SimpleGraphs.SimpleEdge
) -> NestedEdge
Convert a global view of an edge to local view NestedEdge
NestedGraphs.nestedvertex — Methodnestedvertex(ng::NestedGraph, v) -> Any
NestedGraphs.roll_vertex — Methodroll_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
NestedGraphs.subgraph — Methodsubgraph(ng::NestedGraph, v::Integer) -> Integer
Get the subgraph index of a vertex v
NestedGraphs.subgraphedge — Methodsubgraphedge(
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
NestedGraphs.unroll_vertex — Methodunroll_vertex(ng::NestedGraph, v::Integer) -> Vector
Unroll a nested vertex along all the nested graph subgraphs
NestedGraphs.vertex — Methodvertex(
ng::NestedGraph,
cv::Tuple{T, T} where T<:Integer
) -> Union{Nothing, Int64}
Convert a local view NestedVertex to a global view
NestedGraphs.vertex — Methodvertex(
ng::NestedGraph,
d::Integer,
v::Integer
) -> Union{Nothing, Int64}
NestedGraphs.NestedEdge — Typestruct NestedEdge{T<:Integer} <: Graphs.SimpleGraphs.AbstractSimpleEdge{T<:Integer}src::Tuple{T, T} where T<:Integerdst::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.
NestedGraphs.NestedGraph — Typestruct 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 edgesgrv::Vector{N} where N<:AbstractGraph: Original subgraph graphsneds::Array{NestedEdge{T}, 1} where T<:Integer: intersubgraph edgesvmap::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.
NestedGraphs.NestedGraph — MethodNestedGraph(
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.
NestedGraphs.NestedGraph — Methodextrasubgraph controls the NestedGraph should be initialized with an empty subgraph
NestedGraphs.NestedVertex — Typestruct 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.
Index
NestedGraphs.NestedEdgeNestedGraphs.NestedGraphNestedGraphs.NestedGraphNestedGraphs.NestedGraphNestedGraphs.NestedVertexNestedGraphs.edgeNestedGraphs.getallsubgraphpathsNestedGraphs.getallsubverticesNestedGraphs.getfoldedgraphNestedGraphs.getgraphNestedGraphs.getmlsquashedgraphNestedGraphs.getmlverticesNestedGraphs.getnestededgesNestedGraphs.getsquashedgraphNestedGraphs.getsubgraphsNestedGraphs.gettotalsubgraphsNestedGraphs.nestededgeNestedGraphs.nestedvertexNestedGraphs.roll_vertexNestedGraphs.subgraphNestedGraphs.subgraphedgeNestedGraphs.unroll_vertexNestedGraphs.vertexNestedGraphs.vertex