Description
For directed edges allow any gap at most one; for undirected edges require absolute gap at most one.
Local graph quantities describe a vertex, an edge, or a small neighborhood. Their algebra often assumes a simple undirected graph; using the same expression for loops, multigraphs, or directed data can change its meaning.
For directed edges allow any gap at most one; for undirected edges require absolute gap at most one.
When to use this tool
Use Bfs Layer Edge Level Gap when you need a local graph quantity from explicitly supplied neighborhoods or counts.
How to use the tool and how it works
- Enter firstLevel, secondLevel, directed. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read gap, compatible. Inspect compatible before interpreting the associated values.
Require nonnegative integer endpoint levels and return secondLevel-firstLevel. For directed edges allow any gap at most one; for undirected edges require absolute gap at most one.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| firstLevel | First Level | Required. Safe integer; minimum 0. |
| secondLevel | Second Level | Required. Safe integer; minimum 0. |
| directed | Directed | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| gap | Difference on the stated unit and subtraction basis. | Required. Safe integer. |
| compatible | Compatible | Required. Boolean. |
{
"input": {
"firstLevel": 2,
"secondLevel": 4,
"directed": false
},
"output": {
"gap": 2,
"compatible": false
}
} Limitations and assumptions
- Directed edges may point many levels backward; these local necessary conditions assume valid same-source BFS levels and do not establish distances, reachability, or a valid traversal.
- 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
Inspect the actual graph or run a full traversal when the claim depends on global structure. Match the algorithm's graph model to direction, loops, multiplicity, and connectivity requirements.
References
Similar or alternative tools
- Graph: Bipartite Edge Partition Pair Check
Return crossesPartitions for opposite-side endpoints and endpointsKnown independently, inside result.
- Graph Color Single Edge Conflict
Return conflict when firstColor equals secondColor literally.