Graphs

Methods for using/analyzing the network model as a graph

CommonOPF.make_graphFunction
make_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"
source
CommonOPF.all_inneighborsFunction
all_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}())
source
CommonOPF.all_outneighborsFunction
all_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}())
source
CommonOPF.next_bus_above_with_outdegree_more_than_oneFunction
next_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.

source
CommonOPF.paths_betweenFunction
paths_between(g::MetaGraphsNext.MetaGraph, b1::String, b2::String)::Vector{Vector{String}}

Returns all the paths (as vectors of bus strings) between b1 and b2

source
CommonOPF.trim_above_bus!Function
trim_above_bus!(g::MetaGraphsNext.MetaGraph, bus::String)

Remove all the busses and edges that are inneighbors (recursively) of bus

source