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
- Host: GitHub
- URL: https://github.com/andrejewski/connectivity
- Owner: andrejewski
- License: isc
- Created: 2016-04-08T03:14:46.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-18T15:48:40.000Z (almost 10 years ago)
- Last Synced: 2025-05-15T11:13:24.331Z (9 months ago)
- Language: JavaScript
- Size: 134 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```