Skip to content

Main content

Graph Component Merge Count Step Tool

Calculate graph component merge count step from explicit caller-supplied inputs.

Loading tool…

Description

Preserve the count for a within-component edge or subtract one for a connecting edge.

Connected components partition a graph by reachability. Removing bridges creates an edge-connectivity partition; this differs from vertex-biconnected decomposition, which concerns articulation vertices and has different blocks.

Preserve the count for a within-component edge or subtract one for a connecting edge.

When to use this tool

Use Graph Component Merge Count Step when you need a component or bridge-related count under the specified undirected graph model.

How to use the tool and how it works

  1. Enter components, endpointsSameComponent. 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 components, delta. Use the output convention below.

Require positive integer components and at least two when endpointsSameComponent is false. Preserve the count for a within-component edge or subtract one for a connecting edge.1

Input fieldMeaning and unitsAccepted input
componentsComponentsRequired. Safe integer; minimum 1.
endpointsSameComponentEndpoints Same ComponentRequired. Boolean.
Output fieldInterpretationReturned shape
componentsComponentsRequired. Safe integer.
deltaDeltaRequired. Safe integer.
json
{
  "input": {
    "components": 5,
    "endpointsSameComponent": false
  },
  "output": {
    "components": 4,
    "delta": -1
  }
}

Limitations and assumptions

  • Component membership is supplied and no graph is inspected or changed; this does not independently compute connected components.
  • 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

Traverse the supplied graph for an independently derived partition. Use articulation-point and vertex-biconnected algorithms when vertex removal, rather than edge removal, is the relevant failure model.

References

  1. Calculation and input contract: graph/graph-component-merge-count-step — tool.io

Similar or alternative tools