Skip to content

Main content

Undirected Edge Stub Count Contribution Tool

Calculate undirected edge stub count contribution from explicit caller-supplied inputs.

Loading tool…

Description

Count one contribution for each endpoint equal to vertex, so a loop at that vertex contributes two.

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.

Count one contribution for each endpoint equal to vertex, so a loop at that vertex contributes two.

When to use this tool

Use Undirected Edge Stub Count Contribution when you need a degree or incidence calculation under the stated graph convention.

How to use the tool and how it works

  1. Enter source, target, vertex. 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 degreeContribution, loop. Inspect loop before interpreting the associated values.

Count one contribution for each endpoint equal to vertex, so a loop at that vertex contributes two. Report loop independently when source equals target.1

Input fieldMeaning and unitsAccepted input
sourceSourceRequired. Text; maximum UTF-16 length 8192.
targetTargetRequired. Text; maximum UTF-16 length 8192.
vertexVertexRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
degreeContributionDegree ContributionRequired. Safe integer.
loopLoopRequired. Boolean.
json
{
  "input": {
    "source": "a",
    "target": "a",
    "vertex": "a"
  },
  "output": {
    "degreeContribution": 2,
    "loop": true
  }
}

Limitations and assumptions

  • A loop elsewhere has loop true and zero degreeContribution; this is one literal undirected edge record, without verifying graph membership or degree totals.
  • 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

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/undirected-edge-stub-count-contribution — tool.io

Similar or alternative tools