edges-to-adjacency-list

WebJar for edges-to-adjacency-list

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

edges-to-adjacency-list
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

edges-to-adjacency-list
WebJar for edges-to-adjacency-list
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mikolalysenko/edges-to-adjacency-list

Download edges-to-adjacency-list

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/edges-to-adjacency-list/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>edges-to-adjacency-list</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/edges-to-adjacency-list/
implementation 'org.webjars.npm:edges-to-adjacency-list:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/edges-to-adjacency-list/
implementation ("org.webjars.npm:edges-to-adjacency-list:1.0.0")
'org.webjars.npm:edges-to-adjacency-list:jar:1.0.0'
<dependency org="org.webjars.npm" name="edges-to-adjacency-list" rev="1.0.0">
  <artifact name="edges-to-adjacency-list" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='edges-to-adjacency-list', version='1.0.0')
)
libraryDependencies += "org.webjars.npm" % "edges-to-adjacency-list" % "1.0.0"
[org.webjars.npm/edges-to-adjacency-list "1.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : uniq jar [1.0.0,2)

Project Modules

There are no modules declared in this project.

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

Versions

Version
1.0.0