Description
Return vertexCount edges for closed traversal or max(0, vertexCount - 1) for open traversal.
A graph has vertices, edges, and a convention for direction, loops, and repeated edges. A local condition such as an edge count or degree sum may be necessary for a structure without proving that the full graph has that structure.
Return vertexCount edges for closed traversal or max(0, vertexCount - 1) for open traversal.
When to use this tool
Use Path Edge Count From Vertex Count when you need one graph-record component or necessary structural check.
How to use the tool and how it works
- Enter vertexCount, closed. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read edgeCount. Use the output convention below.
Return vertexCount edges for closed traversal or max(0, vertexCount - 1) for open traversal. Reject a closed traversal with zero vertices.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| vertexCount | Vertex Count | Required. Safe integer; minimum 0. |
| closed | Closed | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| edgeCount | Edge Count | Required. Safe integer. |
{
"input": {
"vertexCount": 6,
"closed": false
},
"output": {
"edgeCount": 5
}
} Limitations and assumptions
- This assumes the declared ordered traversal convention; vertices are not inspected and a closed singleton counts one edge, without enforcing simple-cycle rules.
- 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
Validate the complete graph, including connectivity and edge conventions, before drawing a structural conclusion.
References
Similar or alternative tools
- Tree Degree Excess Check
Validate a nonempty degree list with each degree within 0 to n-1.
- Edge Loop Endpoint Check
Require nonempty sourceId and targetId and return their exact equality as selfLoop.