Description
Count degree-one vertices and sum the two-minus-degree contributions of a supplied degree list.
Graph records separate vertex/edge identities, direction, degree counts and weighted-entry conventions. A zero weight differs from no edge, and local degree balance or endpoint continuity does not establish a whole graph’s connectivity or a valid traversal. Parallel edges need an explicit occurrence convention.
Count degree-one vertices and sum the two-minus-degree contributions of a supplied degree list.
When to use this tool
Use Tree Leaf Degree Deficit when checking the stated graph degree, walk, key or entry-presence convention.
How to use the tool and how it works
- Enter degrees. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read leafCount, totalTwoMinusDegree. Use the output convention below.
Require nonnegative whole supplied degrees. Count entries equal to one and sum 2-degree using exact integer intermediates, exporting the total as a number.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| degrees | Degrees | Required. Array of safe integer; maximum items 256. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| leafCount | Leaf Count | Required. Safe integer. |
| totalTwoMinusDegree | Numeric export of sum(2-degree) with exact integer intermediates; not an exact decimal-text result. | Required. Safe integer. |
{
"input": {
"degrees": [
1,
2,
1
]
},
"output": {
"leafCount": 2,
"totalTwoMinusDegree": 2
}
} Limitations and assumptions
- The degree list is not checked for realizability, connectivity or a tree; numerical export does not promise arbitrary-precision integer text.
- 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.
Alternative or Complementary methods
Use the complete graph and appropriate structural/traversal algorithms for realizability, connectivity, Eulerian properties and globally unique edge handling.
References
Similar or alternative tools
- Digraph In Out Degree Imbalance
Calculate a directed vertex's out-degree minus in-degree and report balance.
- Vertex Neighbor Degree Sum Tool
Sum explicitly supplied distinct-neighbor degrees without reconstructing a graph.