// Find an Eulerian trail or circuit over this collection's edges
eles.hierholzer(rootOrOptions?: HierholzerOptions | Collection<any, any, any> | undefined, directed?: boolean | undefined): HierholzerResultFind an Eulerian trail or circuit over this collection's edges. The directed mode checks directed degree balance; the default treats edges as undirected. A requested root must be a valid starting node for the trail.
| Name | Description |
|---|---|
rootOrOptions: HierholzerOptions | Collection<any, any, any> | undefined? | Starting node or an options object; omit to choose an eligible node. |
directed: boolean | undefined? | True to follow outgoing edges only; defaults to false. |
HierholzerResult{ found, trail }; trail is undefined when no trail exists. Collections are sets, so a node visited more than once appears only once in the trail collection.
Example
const result = eles.hierholzer({ root: cy.getElementById('a'), directed: false });console.log(result.found); // trueif a supplied root is a selector string