Description
Sum supplied loopWeights, double that sum on the adjacency diagonal only when doubleOnDiagonal, and always return twice the sum as degreeContribution.
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.
Sum supplied loopWeights, double that sum on the adjacency diagonal only when doubleOnDiagonal, and always return twice the sum as degreeContribution.
When to use this tool
Use Multigraph Loop Adjacency Diagonal Weight when you need a degree or incidence calculation under the stated graph convention.
How to use the tool and how it works
- Enter loopWeights, doubleOnDiagonal. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read diagonal, degreeContribution. Use the output convention below.
Sum supplied loopWeights, double that sum on the adjacency diagonal only when doubleOnDiagonal, and always return twice the sum as degreeContribution.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| loopWeights | Loop Weights | Required. Array of finite number; maximum items 256. |
| doubleOnDiagonal | Double On Diagonal | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| diagonal | Diagonal | Required. Finite number. |
| degreeContribution | Degree Contribution | Required. Finite number. |
{
"input": {
"loopWeights": [
2,
3
],
"doubleOnDiagonal": false
},
"output": {
"diagonal": 5,
"degreeContribution": 10
}
} Limitations and assumptions
- Weights may be signed; the diagonal convention is supplied and the tool does not inspect actual loops, adjacency matrices, or a complete weighted-degree definition.
- 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
Similar or alternative tools
- Graph Self Loop Incidence Convention
Return entry zero only for a directed signed incidence convention, otherwise two.
- Directed Edge Source Target Incidence Sign
Return one when vertex matches target, minus one when it matches source, with cancellation for a self-loop.