Graphs
Methods for using/analyzing the network model as a graph
CommonOPF.make_graph
— Functionmake_graph(edges::AbstractVector{<:AbstractEdge}; directed::Union{Bool,Missing}=missing)
return MetaGraph made up of the edges
Also the graph[:intbusmap] is created with the dicts for bus => int and int => bus (because Graphs.jl only works with integer nodes)
julia> g["13", :bus]
10
julia> g[13, :bus]
"24"
julia> get_prop(g, :int_bus_map)[13]
"24"
CommonOPF.all_inneighbors
— Functionall_inneighbors(g::MetaGraphsNext.MetaGraph, j::String, innies::Vector{String})
A recursive function for finding all of the busses above bus j
. Use like:
busses_above_j = all_inneighbors(g, j, Vector{String}())
CommonOPF.all_outneighbors
— Functionall_outneighbors(g::MetaGraphsNext.MetaGraph, j::String, outies::Vector{String})
A recursive function for finding all of the busses below bus j
. Use like:
busses_above_j = all_outneighbors(g, j, Vector{String}())
CommonOPF.i_to_j
— Functioni_to_j(j::String, net::Network)
all the inneighbors of bus j
CommonOPF.j_to_k
— Functionj_to_k(j::String, net::Network)
all the outneighbors of bus j
CommonOPF.busses_from_deepest_to_source
— Functionbusses_from_deepest_to_source(g::MetaGraphsNext.MetaGraph, source::String)
return the busses and their integer depths in order from deepest from shallowest
CommonOPF.busses_with_multiple_inneighbors
— Functionbusses_with_multiple_inneighbors(g::MetaGraphsNext.MetaGraph)
Find all the busses in g
with indegree > 1
CommonOPF.leaf_busses
— Functionleaf_busses(net::Network)
returns Vector{String}
containing all of the leaf busses in net.graph
CommonOPF.next_bus_above_with_outdegree_more_than_one
— Functionnext_bus_above_with_outdegree_more_than_one(g::MetaGraphsNext.MetaGraph, b::String)
Find the next bus above b
with outdegree more than one. If none are found than nothing
is returned. Throws an error if a bus with indegree > 1 is found above b
.
CommonOPF.paths_between
— Functionpaths_between(g::MetaGraphsNext.MetaGraph, b1::String, b2::String)::Vector{Vector{String}}
Returns all the paths (as vectors of bus strings) between b1
and b2
CommonOPF.trim_above_bus!
— Functiontrim_above_bus!(g::MetaGraphsNext.MetaGraph, bus::String)
Remove all the busses and edges that are inneighbors (recursively) of bus
CommonOPF.vertices_from_deepest_to_source
— Functionvertices_from_deepest_to_source(g::Graphs.AbstractGraph, source::Int64)
returns the integer vertices of g
and their depths from the leafs to source