
Research
/Security News
DuckDB npm Account Compromised in Continuing Supply Chain Attack
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
eulerian-trail
Advanced tools
An implementation of Hierholzer’s Algorithm to find an eulerian trail in a graph
$ npm install --save eulerian-trail
var eulerianTrail = require('eulerian-trail');
eulerianTrail({
edges: [
[0, 1],
[1, 2],
[2, 3],
[3, 6],
[6, 7],
[7, 10],
[0, 10],
[8, 10],
[8, 9],
[9, 10],
[5, 8],
[5, 7],
[7, 8],
[5, 6],
[4, 5],
[3, 4],
[1, 3],
[1, 6]
]
});
// output
// note that the output is reversed from what is shown on the gif
// [ 0, 1, 2, 3, 6, 7, 10, 8, 5, 6, 1, 3, 4, 5, 7, 8, 9, 10, 0 ]
eulerianTrail(options)
params
options.edges
{Array[]} (required) An array of arrays, each subarray describes an edge in the graph, the edge
must have two primitive elements (numbers and strings are allowed)options.directed=false
{boolean} True to denote the edges as directed, by default all the edges are undirectedthrows
The function throws whenever:
returns {Array}
The eulerian trail from a valid start vertex, each pair of contiguous elements in the output denotes an edge
2015 MIT © Mauricio Poppe
FAQs
Finds an Eulerian trail of a graph
We found that eulerian-trail demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.