Socket
Socket
Sign inDemoInstall

edges-to-adjacency-list

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    edges-to-adjacency-list

Convert a list of edges to an adjacency list


Version published
Weekly downloads
80K
decreased by-5.09%
Maintainers
1
Install size
9.68 kB
Created
Weekly downloads
 

Readme

Source

edges-to-adjacency-list

Converts a collection of edges in a graph to an adjacency list representation. For the more general operation on simplicial complexes, use the stars module.

Example

var e2a = require("edges-to-adjacency-list")

console.log(e2a([
  [0, 1],
  [1, 2],
  [2, 3]
]))

Output:

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

Install

npm install edges-to-adjacency-list

API

require("edges-to-adjacency-list")(edges[, numVertices])

Converts a collection of edges to an adjacency list representation.

  • edges are the edges of the graph
  • numVertices is an optional parameter giving the number of vertices in the graph

Returns An array encoding the adjacency list of the graph

Note Repeated edges will be combined.

Credits

(c) 2014 Mikola Lysenko. MIT License

Keywords

FAQs

Last updated on 29 Apr 2014

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc