@@ -169,13 +169,13 @@ mutable struct BipartiteGraph{I <: Integer, M} <: Graphs.AbstractGraph{I}
169169 metadata:: M
170170end
171171function BipartiteGraph (ne:: Integer , fadj:: AbstractVector ,
172- badj:: Union{AbstractVector, Integer} = maximum (maximum, fadj);
173- metadata = nothing )
172+ badj:: Union{AbstractVector, Integer} = maximum (maximum, fadj);
173+ metadata = nothing )
174174 BipartiteGraph (ne, fadj, badj, metadata)
175175end
176176function BipartiteGraph (fadj:: AbstractVector ,
177- badj:: Union{AbstractVector, Integer} = maximum (maximum, fadj);
178- metadata = nothing )
177+ badj:: Union{AbstractVector, Integer} = maximum (maximum, fadj);
178+ metadata = nothing )
179179 BipartiteGraph (mapreduce (length, + , fadj; init = 0 ), fadj, badj, metadata)
180180end
181181
@@ -325,7 +325,7 @@ $(SIGNATURES)
325325Build an empty `BipartiteGraph` with `nsrcs` sources and `ndsts` destinations.
326326"""
327327function BipartiteGraph (nsrcs:: T , ndsts:: T , backedge:: Val{B} = Val (true );
328- metadata = nothing ) where {T, B}
328+ metadata = nothing ) where {T, B}
329329 fadjlist = map (_ -> T[], 1 : nsrcs)
330330 badjlist = B ? map (_ -> T[], 1 : ndsts) : ndsts
331331 BipartiteGraph (0 , fadjlist, badjlist, metadata)
@@ -359,11 +359,11 @@ end
359359has_𝑠vertex (g:: BipartiteGraph , v:: Integer ) = v in 𝑠vertices (g)
360360has_𝑑vertex (g:: BipartiteGraph , v:: Integer ) = v in 𝑑vertices (g)
361361function 𝑠neighbors (g:: BipartiteGraph , i:: Integer ,
362- with_metadata:: Val{M} = Val (false )) where {M}
362+ with_metadata:: Val{M} = Val (false )) where {M}
363363 M ? zip (g. fadjlist[i], g. metadata[i]) : g. fadjlist[i]
364364end
365365function 𝑑neighbors (g:: BipartiteGraph , j:: Integer ,
366- with_metadata:: Val{M} = Val (false )) where {M}
366+ with_metadata:: Val{M} = Val (false )) where {M}
367367 require_complete (g)
368368 M ? zip (g. badjlist[j], (g. metadata[i][j] for i in g. badjlist[j])) : g. badjlist[j]
369369end
@@ -389,7 +389,7 @@ Try to construct an augmenting path in matching and if such a path is found,
389389update the matching accordingly.
390390"""
391391function construct_augmenting_path! (matching:: Matching , g:: BipartiteGraph , vsrc, dstfilter,
392- dcolor = falses (ndsts (g)), scolor = nothing )
392+ dcolor = falses (ndsts (g)), scolor = nothing )
393393 scolor === nothing || (scolor[vsrc] = true )
394394
395395 # if a `vdst` is unassigned and the edge `vsrc <=> vdst` exists
@@ -421,7 +421,7 @@ vertices, subject to the constraint that vertices for which `srcfilter` or `dstf
421421return `false` may not be matched.
422422"""
423423function maximal_matching (g:: BipartiteGraph , srcfilter = vsrc -> true ,
424- dstfilter = vdst -> true , :: Type{U} = Unassigned) where {U}
424+ dstfilter = vdst -> true , :: Type{U} = Unassigned) where {U}
425425 matching = Matching {U} (ndsts (g))
426426 foreach (Iterators. filter (srcfilter, 𝑠vertices (g))) do vsrc
427427 construct_augmenting_path! (matching, g, vsrc, dstfilter)
@@ -550,7 +550,7 @@ Base.length(it::BipartiteEdgeIter) = ne(it.g)
550550Base. eltype (it:: BipartiteEdgeIter ) = edgetype (it. g)
551551
552552function Base. iterate (it:: BipartiteEdgeIter{SRC, <:BipartiteGraph{T}} ,
553- state = (1 , 1 , SRC)) where {T}
553+ state = (1 , 1 , SRC)) where {T}
554554 @unpack g = it
555555 neqs = nsrcs (g)
556556 neqs == 0 && return nothing
@@ -572,7 +572,7 @@ function Base.iterate(it::BipartiteEdgeIter{SRC, <:BipartiteGraph{T}},
572572end
573573
574574function Base. iterate (it:: BipartiteEdgeIter{DST, <:BipartiteGraph{T}} ,
575- state = (1 , 1 , DST)) where {T}
575+ state = (1 , 1 , DST)) where {T}
576576 @unpack g = it
577577 nvars = ndsts (g)
578578 nvars == 0 && return nothing
@@ -644,7 +644,7 @@ mutable struct DiCMOBiGraph{Transposed, I, G <: BipartiteGraph{I}, M <: Matching
644644 ne:: Union{Missing, Int}
645645 matching:: M
646646 function DiCMOBiGraph {Transposed} (g:: G , ne:: Union{Missing, Int} ,
647- m:: M ) where {Transposed, I, G <: BipartiteGraph{I} , M}
647+ m:: M ) where {Transposed, I, G <: BipartiteGraph{I} , M}
648648 new {Transposed, I, G, M} (g, ne, m)
649649 end
650650end
@@ -671,7 +671,7 @@ struct CMONeighbors{Transposed, V}
671671 g:: DiCMOBiGraph{Transposed}
672672 v:: V
673673 function CMONeighbors {Transposed} (g:: DiCMOBiGraph{Transposed} ,
674- v:: V ) where {Transposed, V}
674+ v:: V ) where {Transposed, V}
675675 new {Transposed, V} (g, v)
676676 end
677677end
0 commit comments