Skip to content

Commit

Permalink
Combinatorics: added connectivity(::Graph{Undirected})
Browse files Browse the repository at this point in the history
  • Loading branch information
YueRen committed Jan 11, 2025
1 parent d8dd95a commit 39b8d36
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/Combinatorics/Graphs/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,31 @@ function shortest_path_dijkstra(g::Graph{T}, s::Int64, t::Int64; reverse::Bool=f
return Polymake.to_one_based_indexing(result)
end

@doc raw"""
connectivity(g::Graph{Undirected})
Return the connectivity of the undirected graph `g`.
# Examples
```jldoctest
julia> g = complete_graph(3);
julia> connectivity(g)
2
julia> rem_edge!(g, 2, 3);
julia> connectivity(g)
1
julia> rem_edge!(g, 1, 3);
julia> connectivity(g)
0
```
"""
connectivity(g::Graph{Undirected}) = Polymake.graph.connectivity(g)

@doc raw"""
is_connected(g::Graph{Undirected})
Expand Down

0 comments on commit 39b8d36

Please sign in to comment.