Analyzer.OverallReciprocationCalculator.CalculateReciprocatedEdgeRatio C# (CSharp) Method

CalculateReciprocatedEdgeRatio() protected method

protected CalculateReciprocatedEdgeRatio ( IGraph oGraph, Int32 iVertexPairsWithBothDirectedEdges ) : Nullable
oGraph IGraph
iVertexPairsWithBothDirectedEdges System.Int32
return Nullable
        CalculateReciprocatedEdgeRatio
        (
            IGraph oGraph,
            Int32 iVertexPairsWithBothDirectedEdges
        )
        {
            Debug.Assert(oGraph != null);
            Debug.Assert(oGraph.Directedness == GraphDirectedness.Directed);
            Debug.Assert(iVertexPairsWithBothDirectedEdges >= 0);
            
            Int32 iTotalEdgesAfterMergingDupcliatesNoSelfLoops =
                new DuplicateEdgeDetector(oGraph)
                .TotalEdgesAfterMergingDuplicatesNoSelfLoops;

            if (iTotalEdgesAfterMergingDupcliatesNoSelfLoops == 0)
            {
                return (null);
            }

            return ((Double)iVertexPairsWithBothDirectedEdges * 2.0 /
                (Double)iTotalEdgesAfterMergingDupcliatesNoSelfLoops);
        }