@TestClass(value="org.openscience.cdk.graph.MatchingTest") public final class Matching extends Object
match(int, int)
, any existing match for the newly matched
vertices is no-longer available. The status of a vertex can be queried with
matched(int)
and the matched vertex obtained with other(int)
. Modifier and Type | Method and Description |
---|---|
void |
match(int u,
int v)
Add the edge '{u,v}' to the matched edge set.
|
boolean |
matched(int v)
Determine if a vertex has a match.
|
int |
other(int v)
Access the vertex matched with 'v'.
|
boolean |
perfect(int[][] graph,
BitSet subset)
Attempt to augment the matching such that it is perfect over the subset
of vertices in the provided graph.
|
String |
toString() |
void |
unmatch(int v)
Remove a matching for the specified vertex.
|
boolean |
unmatched(int v)
Determine if a vertex is not matched.
|
static Matching |
withCapacity(int capacity)
Create an empty matching with the specified capacity.
|
@TestMethod(value="match") public void match(int u, int v)
u
- a vertexv
- another vertex@TestMethod(value="other") public int other(int v)
v
- vertexIllegalArgumentException
- the vertex is currently unmatched@TestMethod(value="unmatch") public void unmatch(int v)
v
- vertex@TestMethod(value="nop") public boolean matched(int v)
v
- vertex@TestMethod(value="nop") public boolean unmatched(int v)
v
- a vertex@TestMethod(value="fulvelene2") public boolean perfect(int[][] graph, BitSet subset)
graph
- adjacency list representation of graphsubset
- subset of verticesIllegalArgumentException
- the graph was a different size to the
matching capacity@TestMethod(value="nop") public static Matching withCapacity(int capacity)
capacity
- maximum number of vertices@TestMethod(value="string") public String toString()
Copyright © 2014. All Rights Reserved.