# gramoloss

> Graph theory package for edition and computation

Latest version **2.0.0** (published 2025-07-04) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 35/100 (D)** — status: maintenance-mode.

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

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2025-07-04 |
| First published | 2022-11-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 547.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | lucas-test, ypln |
| Keywords | graph, graph-theory, network |

## Links

- npm: https://www.npmjs.com/package/gramoloss
- Repository: https://github.com/lucas-test/gramoloss
- Homepage: https://github.com/lucas-test/gramoloss#readme
- Issues: https://github.com/lucas-test/gramoloss/issues
- npm.io page: https://npm.io/package/gramoloss

## 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

- 2.0.0 (latest) — 2025-07-04
- 1.10.16 — 2025-01-17
- 1.10.15 — 2025-01-17
- 1.10.14 — 2025-01-08
- 1.10.13 — 2025-01-07
- 1.10.12 — 2024-12-20
- 1.10.11 — 2024-12-20
- 1.10.10 — 2024-12-20
- 1.10.9 — 2024-12-20
- 1.10.8 — 2024-12-20
- 1.10.7 — 2024-12-02
- 1.10.6 — 2024-04-23
- 1.10.5 — 2024-04-22
- 1.10.4 — 2024-04-19
- 1.10.3 — 2024-04-19
- … 99 more at https://npm.io/package/gramoloss/versions

## README

# Gramoloss

Graph (or network) theory tools.

This package contains a graph structure mixing list adjacencies and matrices. Several graph parameters are implemented (degree statistics, chromatic number, vertex cover number, clique number, domination number, ...).

This package is mainly devoted to the online collaborative graph editor [gracoon.com](https://www.gracoon.com) :rocket:

## Install

    npm install gramoloss

## Examples

### Graph edition

```typescript
import {Graph} from "gramoloss";
const g = new Graph();
g.addVertex(0);
g.addVertex('a');
g.addLink(0, 'a');
g.nbVertices(); // = 2
g.nbEdges(); // = 1
```

```typescript
const g = Graph.fromEdges([[0,1],[0,2],[1,2]]); // Create an undirected graph from list of edges
g.maxDegree(); // = 2
g.hasCycle(); // = true
```

### Chromatic number

```typescript
const g = Graph.clique(3); // Create the graph K3
g.chromaticNumber(); // = 3
```

## Notions

- Graph structure allow having edges and arcs simultaneously
- Multiple edges and multiple arcs are allowed
- Loops are allowed



## Contribute

There are a lot of parameters, generators, modifiers and tests to write. It is planned also to rewrite this package in Rust and to generate a typescript package with WASM.

## License

MIT

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