Skip to content

Main content

Bfs Layer Edge Level Gap Tool

Check the necessary BFS level constraint for a directed edge from first to second or an undirected edge.

Loading tool…

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

  1. Enter firstLevel, secondLevel, directed. 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 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 fieldMeaning and unitsAccepted input
firstLevelFirst LevelRequired. Safe integer; minimum 0.
secondLevelSecond LevelRequired. Safe integer; minimum 0.
directedDirectedRequired. Boolean.
Output fieldInterpretationReturned shape
gapDifference on the stated unit and subtraction basis.Required. Safe integer.
compatibleCompatibleRequired. Boolean.
json
{
  "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

  1. Calculation and input contract: graph/bfs-layer-edge-level-gap — tool.io

Similar or alternative tools