@@ -42,6 +42,31 @@ public void MaxBiPartiteMatch_AdjacencyListGraph_Smoke_Test()
4242 Assert . AreEqual ( result . Count , 4 ) ;
4343 }
4444
45+ /// <summary>
46+ /// Test Max BiParitite Edges using Ford-Fukerson algorithm
47+ /// </summary>
48+ [ TestMethod ]
49+ public void MaxBiPartiteMatch_AdjacencyListGraph_Accuracy_Test_1 ( )
50+ {
51+ var graph = new Advanced . Algorithms . DataStructures . Graph . AdjacencyList . Graph < char > ( ) ;
52+
53+ graph . AddVertex ( '0' ) ;
54+ graph . AddVertex ( '1' ) ;
55+ graph . AddVertex ( '2' ) ;
56+ graph . AddVertex ( '3' ) ;
57+
58+
59+ graph . AddEdge ( '0' , '2' ) ;
60+ graph . AddEdge ( '1' , '3' ) ;
61+
62+
63+ var algorithm = new BiPartiteMatching < char > ( new BiPartiteMatchOperators ( ) ) ;
64+
65+ var result = algorithm . GetMaxBiPartiteMatching ( graph ) ;
66+
67+ Assert . AreEqual ( result . Count , 2 ) ;
68+ }
69+
4570 [ TestMethod ]
4671 public void MaxBiPartiteMatch_AdjacencyMatrixGraph_Smoke_Test ( )
4772 {
@@ -74,6 +99,31 @@ public void MaxBiPartiteMatch_AdjacencyMatrixGraph_Smoke_Test()
7499
75100 Assert . AreEqual ( result . Count , 4 ) ;
76101 }
102+
103+ /// <summary>
104+ /// Test Max BiParitite Edges using Ford-Fukerson algorithm
105+ /// </summary>
106+ [ TestMethod ]
107+ public void MaxBiPartiteMatch_AdjacencyMatrixGraph_Accuracy_Test_1 ( )
108+ {
109+ var graph = new Advanced . Algorithms . DataStructures . Graph . AdjacencyMatrix . Graph < char > ( ) ;
110+
111+ graph . AddVertex ( '0' ) ;
112+ graph . AddVertex ( '1' ) ;
113+ graph . AddVertex ( '2' ) ;
114+ graph . AddVertex ( '3' ) ;
115+
116+
117+ graph . AddEdge ( '0' , '2' ) ;
118+ graph . AddEdge ( '1' , '3' ) ;
119+
120+
121+ var algorithm = new BiPartiteMatching < char > ( new BiPartiteMatchOperators ( ) ) ;
122+
123+ var result = algorithm . GetMaxBiPartiteMatching ( graph ) ;
124+
125+ Assert . AreEqual ( result . Count , 2 ) ;
126+ }
77127 /// <summary>
78128 /// operators for generics
79129 /// implemented for int type for edge weights
0 commit comments