@@ -133,22 +133,39 @@ all_maximal_cliques(g::SimpleGraph{T}; kwargs...
133133 ) where T = all_maximal_cliques (Vector{T}, g; kwargs... )
134134
135135
136- """
137- maximum_clique(::Type{U}, g::SimpleGraph{T}; kwargs...) where {T,U} -> (U, Symbol)
138-
139- Calculate maximum clique.
140- """
141- function Graphs. maximum_clique (:: Type{U} , g:: SimpleGraph{T} ; kwargs... ) where {T,U}
142- state = MaxCliqueState {T,U} (g; kwargs... ) # FIXME : this is piracy
143- expand! (state, Set (vertices (g)), Set (vertices (g)))
144- if state. status == :ongoing
145- state. status = :done
136+ if @isdefined (maximum_clique) # Graphs 1.14+ defines maximum_clique
137+ """
138+ maximum_clique(::Type{U}, g::SimpleGraph{T}; kwargs...) where {T,U} -> (U, Symbol)
139+
140+ Calculate maximum clique.
141+ """
142+ function Graphs. maximum_clique (:: Type{U} , g:: SimpleGraph{T} ; kwargs... ) where {T,U}
143+ state = MaxCliqueState {T,U} (g; kwargs... ) # FIXME : this is piracy
144+ expand! (state, Set (vertices (g)), Set (vertices (g)))
145+ if state. status == :ongoing
146+ state. status = :done
147+ end
148+ return state. maxsofar, state. status
146149 end
147- return state. maxsofar, state. status
150+ Graphs. maximum_clique (g:: SimpleGraph{T} ; kwargs...
151+ ) where T = maximum_clique (Vector{T}, g; kwargs... ) # FIXME : this is piracy
152+ else # Julia 1.9 cannot install Graphs 1.14+
153+ """
154+ maximum_clique(::Type{U}, g::SimpleGraph{T}; kwargs...) where {T,U} -> (U, Symbol)
155+
156+ Calculate maximum clique.
157+ """
158+ function maximum_clique (:: Type{U} , g:: SimpleGraph{T} ; kwargs... ) where {T,U}
159+ state = MaxCliqueState {T,U} (g; kwargs... )
160+ expand! (state, Set (vertices (g)), Set (vertices (g)))
161+ if state. status == :ongoing
162+ state. status = :done
163+ end
164+ return state. maxsofar, state. status
165+ end
166+ maximum_clique (g:: SimpleGraph{T} ; kwargs...
167+ ) where T = maximum_clique (Vector{T}, g; kwargs... )
148168end
149- Graphs. maximum_clique (g:: SimpleGraph{T} ; kwargs...
150- ) where T = maximum_clique (Vector{T}, g; kwargs... ) # FIXME : this is piracy
151-
152169
153170
154171# Connected cliques (c-cliques)
0 commit comments