Class Matching

java.lang.Object
  |
  +--Matching

public class Matching
extends java.lang.Object

This class implements the MAXPARRING algorithm studied in the traditional compulsory first year dADS assignment. In the incidence matrix, 0 means no edge, 1 means edge from left to right and -1 means edge from right to left. In the color arrays, 0 means white, 1 means gray, 2 means black.


Field Summary
static int LEFTEDGE
           
static int NOEDGE
           
static int RIGHTEDGE
           
 
Constructor Summary
Matching()
           
 
Method Summary
static int[] bipartiteMaxMatch(int[][] incMat)
          Returns an array in which the indices are indices to the left side and the values are indices to the right side of the bipartite graph represented in incidenceMatrix.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOEDGE

public static final int NOEDGE
See Also:
Constant Field Values

RIGHTEDGE

public static final int RIGHTEDGE
See Also:
Constant Field Values

LEFTEDGE

public static final int LEFTEDGE
See Also:
Constant Field Values
Constructor Detail

Matching

public Matching()
Method Detail

main

public static void main(java.lang.String[] args)

bipartiteMaxMatch

public static int[] bipartiteMaxMatch(int[][] incMat)
Returns an array in which the indices are indices to the left side and the values are indices to the right side of the bipartite graph represented in incidenceMatrix. A value of -1 means that the vertex at the index in question has not been matched.