Skip to content

Commit 268af58

Browse files
committed
Update HopcroftKarp_Tests.cs
1 parent 7dd77a6 commit 268af58

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

tests/Advanced.Algorithms.Tests/Graph/Matching/HopcroftKarp_Tests.cs

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void HopcroftKarp_AdjacencyListGraph_Smoke_Test()
4646
public void HopcroftKarp_AdjacencyMatrixGraph_Smoke_Test()
4747
{
4848

49-
var graph = new Advanced.Algorithms.DataStructures.Graph.AdjacencyMatrix.Graph<char>();
49+
var graph = new Algorithms.DataStructures.Graph.AdjacencyMatrix.Graph<char>();
5050

5151
graph.AddVertex('A');
5252
graph.AddVertex('B');
@@ -76,5 +76,36 @@ public void HopcroftKarp_AdjacencyMatrixGraph_Smoke_Test()
7676
Assert.AreEqual(result.Count, 4);
7777

7878
}
79+
80+
//[TestMethod]
81+
public void HopcroftKarp_AdjacencyListGraph_Accurancy_Test_1()
82+
{
83+
84+
var graph = new Advanced.Algorithms.DataStructures.Graph.AdjacencyList.Graph<char>();
85+
86+
graph.AddVertex('A');
87+
graph.AddVertex('B');
88+
graph.AddVertex('C');
89+
graph.AddVertex('D');
90+
graph.AddVertex('E');
91+
graph.AddVertex('F');
92+
93+
graph.AddEdge('A', 'D');
94+
graph.AddEdge('A', 'E');
95+
graph.AddEdge('A', 'F');
96+
graph.AddEdge('B', 'D');
97+
graph.AddEdge('B', 'E');
98+
graph.AddEdge('B', 'F');
99+
graph.AddEdge('C', 'D');
100+
graph.AddEdge('C', 'E');
101+
graph.AddEdge('C', 'F');
102+
103+
var algorithm = new HopcroftKarpMatching<char>();
104+
105+
var result = algorithm.GetMaxBiPartiteMatching(graph);
106+
107+
Assert.AreEqual(result.Count, 4);
108+
109+
}
79110
}
80111
}

0 commit comments

Comments
 (0)