An open API service indexing awesome lists of open source software.

https://github.com/andrejewski/connectivity

determine if a graph is connected using its adjacency matrix
https://github.com/andrejewski/connectivity

Last synced: 9 months ago
JSON representation

determine if a graph is connected using its adjacency matrix

Awesome Lists containing this project

README

          

# Connectivity
Determine if a graph is connected using its adjacency matrix.

```js
var connectivity; // pending name change for NPM
var assert = require('assert');

var matrix = [
// A B C D E F
[0, 0, 0, 1, 1, 0], // A
[0, 0, 0, 1, 0, 1], // B
[0, 0, 0, 0, 1, 0], // C
[1, 1, 0, 0, 0, 0], // D
[1, 0, 1, 0, 0, 0], // E
[0, 1, 0, 0, 0, 0], // F
];
assert.ok(connectivity(matrix));
```

## Contributing

The scope of this project is very limited and only pull requests correcting subtle bugs or improving performance with proper tests in either case will be accepted.

```bash
# running tests
npm run test
```