TestCalculateGraphMetrics5()
{
// Directed graph, sample from http://
// faculty.ucr.edu/~hanneman/nettext/C8_Embedding.html#reciprocity
//
// ...but with self-loops. The self-loops should not affect the
// results.
Boolean bIsDirected = true;
CreateGraph(bIsDirected);
IVertex oVertexA = m_oVertices.Add();
IVertex oVertexB = m_oVertices.Add();
IVertex oVertexC = m_oVertices.Add();
m_oEdges.Add(oVertexA, oVertexB, bIsDirected);
m_oEdges.Add(oVertexB, oVertexA, bIsDirected);
m_oEdges.Add(oVertexB, oVertexC, bIsDirected);
m_oEdges.Add(oVertexA, oVertexA, bIsDirected);
m_oEdges.Add(oVertexB, oVertexB, bIsDirected);
m_oEdges.Add(oVertexC, oVertexC, bIsDirected);
Nullable<Double> dReciprocatedVertexPairRatio, dReciprocatedEdgeRatio;
m_oOverallReciprocationCalculator.CalculateGraphMetrics(m_oGraph,
out dReciprocatedVertexPairRatio, out dReciprocatedEdgeRatio);
Assert.AreEqual(0.5, dReciprocatedVertexPairRatio.Value);
Assert.AreEqual(0.667, dReciprocatedEdgeRatio.Value, 0.001);
}