Description
Compare source and target using JavaScript string ordering, swap them when source is greater, and return reversed.
Graph identifiers and endpoints describe different kinds of equality. Two edges can connect the same vertices while remaining distinct records, and serialized numeric or string identifiers can lose distinctions during parsing or normalization.
Compare source and target using JavaScript string ordering, swap them when source is greater, and return reversed.
When to use this tool
Use Edge List Single Edge Canonical Order when you need a literal identifier or endpoint comparison with explicit coercion rules.
How to use the tool and how it works
- Enter source, target. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read source, target, reversed. Inspect reversed before interpreting the associated values.
Compare source and target using JavaScript string ordering, swap them when source is greater, and return reversed.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| source | Source | Required. Text; maximum UTF-16 length 8192. |
| target | Target | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| source | Source | Required. Text; maximum UTF-16 length 8192. |
| target | Target | Required. Text; maximum UTF-16 length 8192. |
| reversed | Reversed | Required. Boolean. |
{
"input": {
"source": "z",
"target": "a"
},
"output": {
"source": "a",
"target": "z",
"reversed": true
}
} Limitations and assumptions
- Ordering is lexicographic in UTF-16 units rather than numeric or locale-aware; this supplies an undirected endpoint ordering without verifying identity or graph membership.
- 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
Retain original identifiers and use a declared canonical representation for storage. Resolve actual edge identity through the graph's data model rather than endpoint coincidence alone.
References
Similar or alternative tools
- Edge Reciprocity Indicator
Return reciprocal when both flags are true and count one edge for a present self-loop or the separate directed flags otherwise.
- Graph Label Canonical Number String Guard
Require nonempty label, convert it to Number, and mark canonical only when it is a safe integer whose String conversion exactly matches the original label.