Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

maximal-independent-set

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

maximal-independent-set

Maximal independent vertex sets

  • 0.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-25%
Maintainers
1
Weekly downloads
 
Created
Source

maximal-independent-set

Finds a maximal independent vertex set. No guarantees that it is maximum.

Install

npm install maximal-independent-set

Example

var independetSet = require("maximal-independent-set")

//Generate a graph
console.log(independentSet(
  [[1, 3],
   [0, 2],
   [3, 1],
   [0, 2]]))

require("maximal-independent-set")(adjacency_list[, result])

Given a graph encoded as an adjacency list, compute a maximal independent vertex set (aka vertex packing).

  • adjacency_list is an array with length = number of vertices, where each ith entry is an array representing the neighbors of vertex i. If your graph is encoded as an edge list instead of an adjacency list, you can use the stars npm module to make the necessary conversion.
  • result is an optional array that gets the result of the independent set. If not specified, a new Uint8Array is created.

Returns A vector whose ith entry determines whether the vertex is contained in the independent set or not

Credits

(c) 2013 Mikola Lysenko. MIT License

Keywords

FAQs

Package last updated on 05 Apr 2013

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc