PathGraph
A path graph — vertices joined in a line.
PathGraph(vertices)a path along vertices, in the order given — Wolfram's own (and only) form.PathGraph(n)the path — our own convenience extension.Typed signatures
| Type | Package | Applies |
|---|---|---|
(any) -> value | combinatorics | always |
Details
PathGraph(n)is a convenience this library adds;PathGraph[3]is an ERROR in real Wolfram (kernel-verified) — it only accepts a vertex list. Both forms are accepted here, but the Wolfram transpiler treats the whole head as foreign (its own context, not a plain rename) since it cannot tell the two call shapes apart — seeFOREIGNin@enumeratio/wolfram.
Examples
About
| Examples | 2 |
|---|
Implementation
mapped
wolframpackages/oracle/src/mappings.tsReal Wolfram's PathGraph takes a vertex list only -- our bare-integer form errors there (kernel-verified). Arity can't tell the two call shapes apart (both are arity 1), so the whole head is left unmapped rather than risk handing the kernel a call it rejects; see FOREIGN in @enumeratio/wolfram. Wolfram Function Repository searched; nothing that accepts both a bare vertex count and a vertex list under one name.
See also: CycleGraph, CompleteGraph