0.0.26 • Published 5 years ago

@ertrzyiks/graph-utils v0.0.26

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

Graph utils

A library that helps to create, modify and analyze directed, finite graphs in Typescript.

The graph object is represented with adjacency list. It's build from a list of nodes (vertices) and edges connecting them. Additionally, each node and edge can store a record-like object with their custom properties.

https://ertrzyiks.github.io/graph-utils/

Installation

Using Yarn

yarn add @ertrzyiks/graph-utils

or NPM

npm i @ertrzyiks/graph-utils --save

Basic usage

import { 
  createGraph, 
  addNodeInPlace, 
  addEdgeInPlace 
} from '@ertrzyiks/graph-utils'

const graph = createGraph()

addNodeInPlace(graph, { id: 'node-1' })
addNodeInPlace(graph, { id: 'node-2' })
addNodeInPlace(graph, { id: 'node-3' })

addEdgeInPlace(graph, { from: 'node-1', to: 'node-2' })
addEdgeInPlace(graph, { from: 'node-2', to: 'node-1' })
addEdgeInPlace(graph, { from: 'node-1', to: 'node-3' })

See more examples at https://ertrzyiks.github.io/graph-utils/examples

0.0.26

5 years ago

0.0.25

5 years ago

0.0.24

5 years ago

0.0.20

5 years ago

0.0.21

5 years ago

0.0.22

5 years ago

0.0.23

5 years ago

0.0.19

5 years ago

0.0.16

5 years ago

0.0.17

5 years ago

0.0.18

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.3

5 years ago

0.0.4

5 years ago

0.0.2

5 years ago