Skip to content

Commit

Permalink
rm check_connected_graph
Browse files Browse the repository at this point in the history
CommonOPF has is_connected(net::Network)::Bool
  • Loading branch information
NLaws committed Apr 20, 2024
1 parent 8726f63 commit 5d8f484
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 20 deletions.
1 change: 0 additions & 1 deletion docs/src/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ rij
xij
zij
check_soc_inequalities
check_connected_graph
get_load_bal_shadow_prices
voltage_values_by_time_bus
current_values_by_time_edge
Expand Down
1 change: 0 additions & 1 deletion src/BranchFlowModel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export
# recover_voltage_current, # TODO validate this method
zij,
check_soc_inequalities,
check_connected_graph,
get_load_bal_shadow_prices,
voltage_values_by_time_bus,
current_values_by_time_edge,
Expand Down
17 changes: 0 additions & 17 deletions src/checks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,6 @@ function check_rank_one(m::JuMP.AbstractModel, p::Inputs{BranchFlowModel.MultiPh
end


"""
check_connected_graph(p::Inputs{SinglePhase})
return true if only one connected graph; false otherwise
this is a good check to do before attempting to solve a model because
if there is more than one sub-graph then it is likely the model will be infeasible
"""
function check_connected_graph(p::Inputs{SinglePhase})
g = make_graph(p.busses, p.edges; directed=true)
if length(connected_components(g)) == 1
return true
end
return false
end


"""
check_any_results_at_bounds(r::Results, p::Inputs{SinglePhase})
Expand Down
1 change: 0 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ end
Ntimesteps = 1,
relaxed = false # NLP
);
@test check_connected_graph(p) == true
g = make_graph(p.busses, p.edges; directed=true)
@test g.graph.ne == Graphs.nv(g) - 1 # a radial network has n_edges = n_vertices - 1
@test_warn "The per unit impedance values should be much less than one" check_unique_solution_conditions(p)
Expand Down

0 comments on commit 5d8f484

Please sign in to comment.