protected void CalculateVertexDegrees
(IVertex oVertex, out Int32 iInDegree, out Int32 iOutDegree)
{
Debug.Assert(oVertex != null);
iInDegree = 0;
iOutDegree = 0;
foreach (IEdge oIncidentEdge in oVertex.IncidentEdges)
{
IVertex[] aoVertices = oIncidentEdge.Vertices;
// Test both of the edge's vertices so that a self-loop is properly
// handled.
if (aoVertices[0] == oVertex)
{
iOutDegree++;
}
if (aoVertices[1] == oVertex)
{
iInDegree++;
}
}
}