Skip to content

Main content

Directed Loop In Out Degree Pair Tool

Calculate directed loop in out degree pair from explicit caller-supplied inputs.

Loading tool…

Description

Return that count as both inDegree and outDegree and twice it as totalDegree.

A graph's degree records how many edge incidences meet a vertex. Directed edges distinguish incoming and outgoing incidences, while loops and parallel edges require explicit counting conventions; a local degree formula does not reconstruct a graph.

Return that count as both inDegree and outDegree and twice it as totalDegree.

When to use this tool

Use Directed Loop In Out Degree Pair when you need a degree or incidence calculation under the stated graph convention.

How to use the tool and how it works

  1. Enter loops. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read inDegree, outDegree, totalDegree. Use the output convention below.

Require nonnegative integer loops. Return that count as both inDegree and outDegree and twice it as totalDegree.1

Input fieldMeaning and unitsAccepted input
loopsLoopsRequired. Safe integer; minimum 0.
Output fieldInterpretationReturned shape
inDegreeIn DegreeRequired. Safe integer.
outDegreeOut DegreeRequired. Safe integer.
totalDegreeTotal DegreeRequired. Safe integer.
json
{
  "input": {
    "loops": 3
  },
  "output": {
    "inDegree": 3,
    "outDegree": 3,
    "totalDegree": 6
  }
}

Limitations and assumptions

  • This is a directed-loop degree contribution rather than the vertex's complete degree; actual loops and other incident edges are not inspected.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Build an adjacency structure and count actual incidences when a full graph is available. Validate loop, multiplicity, direction, and vertex-set assumptions before applying a simple-graph identity.

References

  1. Calculation and input contract: graph/directed-loop-in-out-degree-pair — tool.io

Similar or alternative tools

  • Vertex Loop Degree Contribution

    Give each loop two degree contributions in an undirected graph or total directed degree, and one when directed and counting a single directed-degree side.

  • Multigraph Loop Adjacency Diagonal Weight

    Sum supplied loopWeights, double that sum on the adjacency diagonal only when doubleOnDiagonal, and always return twice the sum as degreeContribution.