Graph Loop Parallel Simplicity Check
Audit explicit edge occurrences for self-loops and parallel endpoint pairs under directed or undirected graph simplicity.
Description
Audit explicit edge occurrences for self-loops and parallel endpoint pairs under directed or undirected graph simplicity.
Graph simplicity requires no self-loop and no repeated endpoint pair under the selected direction convention.
When to use this tool
Audit explicit edge occurrences for self-loops and parallel endpoint pairs under directed or undirected graph simplicity.
- Prepare the supplied edgesJson, directed fields for this operation.
- Compare the complete example with the representation used by your own input before carrying the result into another step.
How to use the tool and how it works
- Enter edgesJson, directed. Use the exact text syntax, units and index conventions explained below.
- Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
- Read result.simple, result.loops, result.parallel. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Find loop indexes and group repeated ordered endpoint pairs in directed mode or sorted endpoint pairs in undirected mode. simple requires both lists empty.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| edgesJson | JSON text, entered as one text field. The decoded structure is illustrated below; it is not a separate file. | Text |
| directed | Explicit choice for directed; supply a boolean rather than a text label. | true or false |
For the JSON text fields, the following decoded structures show the example records before they are serialized into input strings. Keep field names, list nesting and value types as shown.
[
{
"field": "edgesJson",
"decoded": [
{
"id": "a",
"source": "u",
"target": "v",
"weight": 2
},
{
"id": "b",
"source": "v",
"target": "u",
"weight": 4
},
{
"id": "c",
"source": "u",
"target": "u",
"weight": 1
}
]
}
] | Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.simple | Flag for simple under the exact condition described above. |
| result.loops | The loops list in the ordering and representation described above. |
| result.parallel | The parallel list in the ordering and representation described above. |
{
"input": {
"edgesJson": "[{\"id\":\"a\",\"source\":\"u\",\"target\":\"v\",\"weight\":2},{\"id\":\"b\",\"source\":\"v\",\"target\":\"u\",\"weight\":4},{\"id\":\"c\",\"source\":\"u\",\"target\":\"u\",\"weight\":1}]",
"directed": false
},
"output": {
"result": {
"simple": false,
"loops": [
2
],
"parallel": [
{
"key": "[\"u\",\"v\"]",
"indexes": [
0,
1
]
}
]
}
}
} Limitations and assumptions
- Unique edge IDs do not by themselves make a graph simple. Weights are not part of the parallel-edge key.
- Every edge record requires unique string id, string source/target and finite numeric weight, even when this operation does not use the weight. Parallel endpoints and loops are retained unless explicitly filtered.
- Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
- Lists are limited to 128 entries. JSON text must meet bounded size and depth checks, and numeric outputs beyond the safe finite magnitude are rejected. Exact large integers use decimal strings.
- Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.
Alternative or Complementary methods
Choose edge identities, directedness and vertex coverage explicitly. Local edge-list audits and transformations do not replace a graph algorithm with the required connectivity, path or ordering guarantees.
References
Similar or alternative tools
- Edge List Parallel Edge Buckets
Inventory parallel edge occurrences with exact directed or undirected endpoint equivalence; retain multiplicities rather than normalize away duplicates.
- Edge List Self Loop Partitioner
Partition edge observations into self-loops and nonloops while preserving edge IDs, weights and caller order.