# tinygraphs

> Small graph library for directed and undirected graphs.

Latest version **0.10.0** (published 2023-02-21) · mit license · 0 weekly downloads

## Install

```sh
npm install tinygraphs
pnpm add tinygraphs
yarn add tinygraphs
bun add tinygraphs
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.10.0 |
| Published | 2023-02-21 |
| First published | 2019-04-02 |
| Weekly downloads | 0 |
| License | mit |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Simon A. Eugster |
| Maintainers | granjow |
| Keywords | dag, graph |

## Links

- npm: https://www.npmjs.com/package/tinygraphs
- Repository: https://github.com/Granjow/tinygraphs
- Homepage: https://github.com/Granjow/tinygraphs#readme
- Issues: https://github.com/Granjow/tinygraphs/issues
- npm.io page: https://npm.io/package/tinygraphs

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 0.10.0 (latest) — 2023-02-21
- 0.9.0 — 2019-04-02

## README

# tinygraphs

Small graph library for directed and undirected graphs.

## DirectedGraph

Provides very basic functionality for directed graphs, mainly calculating reachable vertices.

```ts
const dg = new DirectedGraph();
dg.addEdge( 0, 1 );
dg.addEdge( 1, 2 );
dg.addEdge( 2, 3 );
dg.reachableVertices( 0 ); // [ 0, 1, 2, 3 ]
```

API:

```text
DirectedGraph
-------------
edgeArray()
hasEdge(from, to)
addEdge(from, to)
reachableVertices(from)
colourise()
```

## UndirectedGraph

This class is almost identical to DirectedGraph except that `addEdge`
adds an edge in both directions.


## Changelog

* **v0.10.0** (2023-02-21)
  * Added: DirectedGraph now has source code comments, readme (this file) improved
  * Changed: Update to latest TypeScript version
* **v0.9.0** (2019-04-02)
  * Previous release. Not sure if it worked correctly.

---
_Source: https://npm.io/package/tinygraphs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
