Satsuma
a delicious .NET graph library
|
Finds a maximum matching in a bipartite graph using the alternating path algorithm. More...
Public Member Functions | |
void | Add (Arc arc) |
Tries to add a specific arc to the current matching. More... | |
void | Clear () |
Removes all arcs from the matching. More... | |
int | GreedyGrow (int maxImprovements=int.MaxValue) |
Grows the current matching greedily. More... | |
MaximumMatching (IGraph graph, Func< Node, bool > isRed) | |
void | Run () |
Grows the current matching to a maximum matching by running the whole alternating path algorithm. More... | |
Properties | |
IGraph | Graph [get, set] |
Func< Node, bool > | IsRed [get, set] |
Describes a bipartition of the input graph by dividing its nodes into red and blue ones. More... | |
IMatching | Matching [get] |
The current matching. More... | |
Finds a maximum matching in a bipartite graph using the alternating path algorithm.
Definition at line 33 of file MaximumMatching.cs.
Definition at line 46 of file MaximumMatching.cs.
void Satsuma.MaximumMatching.Add | ( | Arc | arc | ) |
Tries to add a specific arc to the current matching.
If the arc is already present, does nothing.
arc | An arc of Graph. |
ArgumentException | Trying to add an illegal arc. |
Definition at line 96 of file MaximumMatching.cs.
void Satsuma.MaximumMatching.Clear | ( | ) |
Removes all arcs from the matching.
Implements Satsuma.IClearable.
Definition at line 57 of file MaximumMatching.cs.
int Satsuma.MaximumMatching.GreedyGrow | ( | int | maxImprovements = int.MaxValue | ) |
Grows the current matching greedily.
Can be used to speed up optimization by finding a reasonable initial matching.
maxImprovements | The maximum number of arcs to grow the current matching with. |
Definition at line 70 of file MaximumMatching.cs.
void Satsuma.MaximumMatching.Run | ( | ) |
Grows the current matching to a maximum matching by running the whole alternating path algorithm.
Definition at line 140 of file MaximumMatching.cs.
|
getset |
Definition at line 35 of file MaximumMatching.cs.
|
getset |
Describes a bipartition of the input graph by dividing its nodes into red and blue ones.
Definition at line 37 of file MaximumMatching.cs.
|
get |
The current matching.
Definition at line 42 of file MaximumMatching.cs.