Skip to content

Main content

Graph Walk Vertex Occurrence Position Tool

Calculate graph walk vertex occurrence position from explicit caller-supplied inputs.

Loading tool…

Description

Collect every zero-based position where a walk entry equals vertex and return positions and their count.

A walk is an ordered sequence of visited vertices or edges, while a path normally adds structural restrictions. Sequence manipulation and endpoint checks alone do not verify that every required graph edge exists.

Collect every zero-based position where a walk entry equals vertex and return positions and their count.

When to use this tool

Use Graph Walk Vertex Occurrence Position when you need a sequence transformation, endpoint comparison, or path-related local calculation.

How to use the tool and how it works

  1. Enter walk, 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 positions, occurrences. Use the output convention below.

Collect every zero-based position where a walk entry equals vertex and return positions and their count.1

Input fieldMeaning and unitsAccepted input
walkWalkRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
vertexVertexRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
positionsPositionsRequired. Array of safe integer; maximum items 256.
occurrencesOccurrencesRequired. Safe integer.
json
{
  "input": {
    "walk": [
      "a",
      "b",
      "a",
      "c"
    ],
    "vertex": "a"
  },
  "output": {
    "positions": [
      0,
      2
    ],
    "occurrences": 2
  }
}

Limitations and assumptions

  • Matching is literal and repeated visits are retained; no edges, walk validity, path simplicity, graph membership, or reachability are verified.
  • 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

Validate each consecutive edge against the graph and check the required path or cycle properties. Use a dedicated traversal or shortest-path algorithm when reachability or optimality is the real question.

References

  1. Calculation and input contract: graph/graph-walk-vertex-occurrence-position — tool.io

Similar or alternative tools