Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

bipartite-independent-set

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bipartite-independent-set

Maximum independent set for bipartite graph

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
4
-60%
Maintainers
1
Weekly downloads
 
Created
Source

bipartite-independent-set

This modules computes a maximum independent set for a bipartite graph. It takes O(sqrt(V) * E) time.

Example

var bipartiteIndependentSet = require("bipartite-independent-set")

var s = bipartiteIndependentSet(4, 4, [
    [0, 1],
    [1, 0],
    [1, 1],
    [1, 2],
    [2, 1],
    [3, 2],
    [3, 3]
    ])

// s = [ [ 0, 2, 3 ], [ 0, 2 ] ]

Install

npm install bipartite-independent-set

require("bipartite-independent-set")(n, m, edges)

Finds a maximum independent set for the given bipartite graph.

  • n is a the number of vertices in the first component
  • m is the number of vertices in the second component
  • edges is a list of edges in the bipartite graph represented by pairs of integers

Returns A pair of lists representing the maximum independent set for the graph

Credits

(c) 2014 Mikola Lysenko. MIT License

Keywords

maximum

FAQs

Package last updated on 29 Apr 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