New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

cycle-decomposition

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cycle-decomposition

Computes the cycle decomposition for a permutation

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

cycle-decomposition

Computes the cycle decomposition for a permutation

Example

console.log(require("cycle-decomposition")([3,2,1,0]))

Output:

[ [0,3], [1,2] ]

Install

npm install cycle-decomposition

API

require("cycle-decomposition")(permutation)

The main function in this library takes a length n permutation represented as a sequence of integers from 0 to n-1 describing how the permutation acts on a finite set according to the rule i --> permutation[i].

  • permutation is a permutation

Returns A list of cycles.

Credits

(c) 2013-2014 Mikola Lysenko. MIT License

Keywords

cycle

FAQs

Package last updated on 01 May 2014

Did you know?

Socket

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.

Install

Related posts